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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to rename Column name

Author  Topic 

soori457
Yak Posting Veteran

85 Posts

Posted - 2008-02-29 : 05:46:57
Hai

XYZ (Table name)
a (column name)

Now I have to rename column name a to abc.

alter table xyz
RENAME column a to abc

With this statement, I'm not getting. Its throwing an error

Error : Incorrect syntax near the keyword 'column'.

Can anyone solve this

Thanks in Advance.

Suresh Kumar

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-02-29 : 06:02:20
sp_rename 'xyz.a', 'abc'



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

soori457
Yak Posting Veteran

85 Posts

Posted - 2008-02-29 : 06:20:19
Thanks for your reply Mr.Peso

After executing that statement I'm getting o/p, but it is showing

Caution: Changing any part of an object name could break scripts and stored procedures.

What's the meaning of that

Suresh Kumar
Go to Top of Page

sunsanvin
Master Smack Fu Yak Hacker

1274 Posts

Posted - 2008-02-29 : 06:30:07
it shows like that no need to worry for that.
if you are using the table with the same column name in the previous SP or UDF, then those will be trouble. that is the reason it is showing caution.

Vinod
Even you learn 1%, Learn it with 100% confidence.
Go to Top of Page

soori457
Yak Posting Veteran

85 Posts

Posted - 2008-02-29 : 07:11:57
Thanks for ur replies

Suresh Kumar
Go to Top of Page
   

- Advertisement -