Thursday, March 8, 2012

Columns in Table renaming

I am having the database having more than 50 tables in that I need to
rename a column in all the tables. Is there is way that i can rename
the columns in all the tables without changing it one by one? I'm using
MS SQL 2K
Thanks In advanceYou could use "sp_rename" in conjunction with the un-documented
"sp_MSForEachTable" procedure.
--
HTH,
SriSamp
Email: srisamp@.gmail.com
Blog: http://blogs.sqlxml.org/srinivassampath
URL: http://www32.brinkster.com/srisamp
"ymcj" <june.ymc@.gmail.com> wrote in message
news:1143605480.558575.324360@.j33g2000cwa.googlegroups.com...
> I am having the database having more than 50 tables in that I need to
> rename a column in all the tables. Is there is way that i can rename
> the columns in all the tables without changing it one by one? I'm using
> MS SQL 2K
> Thanks In advance
>

No comments:

Post a Comment