By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,532 Members | 1,514 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,532 IT Pros & Developers. It's quick & easy.

Changing Column Name on a table

P: n/a
Hi All,
I am trying to change column name on an existing table. I am using SQL
Server 7.

As the table is quite big, it is taking quite long time to do it.
By the way I could change the column name only through the Enterprize
Manager.

Is it possible to change the column name using SQL script?
Why the change of column name will depend on the size of the table?

Thanks for your answer.

-Mokles
Jul 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
You can change a column name using sp_rename.

EXEC sp_rename 'MyTable.OldColumnName', 'NewColumnName', 'COLUMN'

See the Books Online for more information.

--
Hope this helps.

Dan Guzman
SQL Server MVP

"mokles" <mo****@rogers.com> wrote in message
news:wI********************@rogers.com...
Hi All,
I am trying to change column name on an existing table. I am using SQL
Server 7.

As the table is quite big, it is taking quite long time to do it.
By the way I could change the column name only through the Enterprize
Manager.

Is it possible to change the column name using SQL script?
Why the change of column name will depend on the size of the table?

Thanks for your answer.

-Mokles

Jul 20 '05 #2

P: n/a
Hi Mokles

Have you tried to rename the field using sp_rename.

Enterprise manager does the job using same kind of scripts but its not
intelligent enough I have observed in various scenarios that sometimes
it accomplishes simple tasks using long approach.

I wonder if there are any indexes on the table ?

Regards
Shehzad
"mokles" <mo****@rogers.com> wrote in message news:<wI********************@rogers.com>...
Hi All,
I am trying to change column name on an existing table. I am using SQL
Server 7.

As the table is quite big, it is taking quite long time to do it.
By the way I could change the column name only through the Enterprize
Manager.

Is it possible to change the column name using SQL script?
Why the change of column name will depend on the size of the table?

Thanks for your answer.

-Mokles

Jul 20 '05 #3

P: n/a
I could do it using Sp_Rename.
Enterprize Manager was using complicated method to do the simple task
Anyway thanks for the help

-Mokles

"Dan Guzman" <gu******@nospam-online.sbcglobal.net> wrote in message
news:6Q*****************@newssvr30.news.prodigy.co m...
You can change a column name using sp_rename.

EXEC sp_rename 'MyTable.OldColumnName', 'NewColumnName', 'COLUMN'

See the Books Online for more information.

--
Hope this helps.

Dan Guzman
SQL Server MVP

"mokles" <mo****@rogers.com> wrote in message
news:wI********************@rogers.com...
Hi All,
I am trying to change column name on an existing table. I am using SQL
Server 7.

As the table is quite big, it is taking quite long time to do it.
By the way I could change the column name only through the Enterprize
Manager.

Is it possible to change the column name using SQL script?
Why the change of column name will depend on the size of the table?

Thanks for your answer.

-Mokles


Jul 20 '05 #4

P: n/a
Today I tried to do it with sp_Rename and it worked well and fast.

Previously I was using profiler to see what the Enterprize Manager was
doing. And really it was using complicated method to change the column name.

Thanks all for the help

-Mokles
"Shehzad Shabbir" <sh*****@internav.com> wrote in message
news:50**************************@posting.google.c om...
Hi Mokles

Have you tried to rename the field using sp_rename.

Enterprise manager does the job using same kind of scripts but its not
intelligent enough I have observed in various scenarios that sometimes
it accomplishes simple tasks using long approach.

I wonder if there are any indexes on the table ?

Regards
Shehzad
"mokles" <mo****@rogers.com> wrote in message

news:<wI********************@rogers.com>...
Hi All,
I am trying to change column name on an existing table. I am using SQL
Server 7.

As the table is quite big, it is taking quite long time to do it.
By the way I could change the column name only through the Enterprize
Manager.

Is it possible to change the column name using SQL script?
Why the change of column name will depend on the size of the table?

Thanks for your answer.

-Mokles

Jul 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.