Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
sg2255551
Constraint Violating Yak Guru
274 Posts |
Posted - 2006-08-11 : 00:08:29
|
| how do i change the column name of a table based on the value of another table? I have 2 tables namely tblData and tblDateFor example:tblData:Col1 Col2 Col3---- ---- ----tblDate:coldate----------08/12/200608/19/200608/26/2006How do i change col1 col2 col3 to 08/12/2006 08/19/2006 08/26/2006. Thanks |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2006-08-11 : 00:17:29
|
| You can use the SP_RENAME stored procedure to rename a column in a table.CODO ERGO SUM |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
|
sg2255551
Constraint Violating Yak Guru
274 Posts |
Posted - 2006-08-11 : 00:40:32
|
| ok, Thanks.My tblData comes from an export package and it is schedule to execute every week and the values of tblDate would change everey week as well.Actually, i have a DTS package that does the export of data from other table to tblData and would like to write some sql statement to rename the columns each time the package execute. How should I write the sql statement to be used in my package? thanks |
 |
|
|
sg2255551
Constraint Violating Yak Guru
274 Posts |
Posted - 2006-08-13 : 22:58:17
|
| hiThanks for the post. I have managed to solved it. Once again.Thanks |
 |
|
|
|
|
|