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 |
|
johnny1walker
Starting Member
17 Posts |
Posted - 2012-03-14 : 09:40:49
|
----change In the name of Table 5 Table 6Use testGOALTER TABLE NAME tablo5 RENAME TO tablo6;GObut error messages::Msg 102, Level 15, State 1, Line 1Incorrect syntax near 'tablo5'.----------------------------------------tablo4 d1 ==> d11 change.Use testGOALTER TABLE tablo4 RENAME COLUMN d1 TO d11;GOerror messages::Msg 102, Level 15, State 1, Line 1Incorrect syntax near 'RENAME' |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2012-03-14 : 10:12:55
|
Is that MS SQL Server?I would use sp_rename... No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
johnny1walker
Starting Member
17 Posts |
Posted - 2012-03-14 : 12:13:12
|
| yes mssqlthanks.i use sp_rename but i dont rename column |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-03-14 : 12:50:23
|
quote: Originally posted by johnny1walker yes mssqlthanks.i use sp_rename but i dont rename column
you can use sp_rename to rename column alsoit will be likeEXEC sp_rename 'Tablename.currentcolumnname', 'Newcolumnname', 'COLUMN';In any case please make sure you do an impact analysis to see dependent objects before you apply the change so that you can reflect changes in all the required places------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|