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 |
|
mavericky
Posting Yak Master
117 Posts |
Posted - 2011-09-27 : 09:46:18
|
| Hi All,Is there any way I can rename a column in sql table with code? I dont want to rename it manually.Thanks,Mavericky |
|
|
vmvadivel
Yak Posting Veteran
69 Posts |
Posted - 2011-09-27 : 10:18:29
|
| EXEC sp_rename @objname = 'YourTableName.YourOldColumnName', @newname = 'YourNewColumnName', @objtype = 'COLUMN' --- this stays as it isBest RegardsVadivelhttp://vadivel.blogspot.com |
 |
|
|
mavericky
Posting Yak Master
117 Posts |
Posted - 2011-09-27 : 10:44:10
|
| is sp_rename an inbuilt stored proc or will i have to make it? |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-09-27 : 11:34:53
|
| its a system stored proc. you just need to call it as shown------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|