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
 Can I change cloumn's name

Author  Topic 

sunnykj
Starting Member

29 Posts

Posted - 2005-09-07 : 01:37:21
I want to change one column 's name which have had data in it?
Can I?

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2005-09-07 : 01:43:04
read sp_rename first in BOL

--------------------
keeping it simple...
Go to Top of Page

sunnykj
Starting Member

29 Posts

Posted - 2005-09-07 : 01:45:28
Sorry,what is the "BOL"?Online book?:)
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2005-09-07 : 02:33:27
BoL is books online. Its installed with the SQL Server client tools, so if you have those installed "Books Online" should be in your Start : Programs : Microsoft SQL Server.

Using SQL you can rename a column using

EXEC sp_rename 'MyTable.MyColumn', 'NewColumnName'

Using enterprise manager you can use the Table Design tool and just type a new name over the top of the old one, it will be "renamed" when you press SAVE.

Kristen
Go to Top of Page

sunnykj
Starting Member

29 Posts

Posted - 2005-09-08 : 02:31:58
Thank You very very much!
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-09-08 : 02:53:32
Make sure that no application is using that table
Otherwise you may get errors from the application and you need to change there also

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -