I haven´t much experiences with SQL Server 2008, I´d like to rename all columns in my database (add to existing name some prefix).
I’m thinking something like:
Foreach( column in table)
(
column_name = prefix+column_name
)
Is there any way to do it??
Thanks so much.
You can try the following solution: iterate through records from sys.columns table using cursor and for each record excute the sp_rename system stored procedure.
I think there can be problems with integrity while renaming, so you need to be careful with other objects (for example stored procedures) that refers for these columns.
UPDATE: MVP says: