Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rename Column name

Status
Not open for further replies.

Jansen

Technical User
Oct 11, 2000
7
TH
Hi there,

I am currently trying to rename column name of a table using MS SQL syntax.

Can it be done?
If it can be done, how do i go out doing that?

Thanks!!

Jansen Khoo
11 oct 2000 [sig][/sig]
 
You can rename a column in the diagram or by using the Design Table option in the Enterprise Manager. [sig]<p>Robert Bradley<br><a href=mailto: > </a><br><a href= - Visual FoxPro Development</a><br> [/sig]
 
Hi there,

I know that i can use the design table option to change the column name but if i were to use coldfusion and i need to write a query to change the column name can it be done?
If it's possible how do i do so?

Thanks!!

Jansen Khoo
12 oct 2000
[sig][/sig]
 
If there is no data in the column, you could use ALTER TABLE to drop the column, then re-add it. [sig]<p>Robert Bradley<br><a href=mailto: > </a><br><a href= - Visual FoxPro Development</a><br> [/sig]
 
Can you run a stored procedure from Coldfusion? If so try sp_rename. [sig][/sig]
 
Hi,

Yes, I have values in my columns.
Is there any other way i can change the name of the column with dropping the entire column and create a new one?

Thanks!!

Jansen
13 oct 2000 [sig][/sig]
 
access the syscolumns table in your database and change what you may. There is a lot of stuff in this table including the column names for all fields. [sig][/sig]
 
I would suggest that you make sure you have your database backed up before trying a direct update of a catalog table. Better yet, don't do it at all. If coldfusion can't handle the standard ways of renaming columns, maybe it's not the right tool for the job. [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top