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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bulk Rename Columns

Status
Not open for further replies.

SQLEC

Programmer
Apr 3, 2006
3
US
Hi Everybody,
Need some ideas on how to bulk rename columns.
The programmer b4 me named everthing like T22Members, T23Cart and all of the columns are also appended with garbage like that as well, there are over 100 tables, views, functions and procs like this. any advise would be appreciated.

Basically I need to remove the T33 from the table names as well as the column names.
 
Dynamic SQL with a cursor fetch, combined with substring, and patindex. It won't be pretty, but it can be done with a bit of programming.

The views and procs will probably be easier to do by hand then by anything else.

Denny
MCSA (2003) / MCDBA (SQL 2000) / MCTS (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top