Renaming a table is a simple task, however one thing most people miss is to find all table dependencies and replace the table in stored procedures/functions/views using that particular table. A T-SQL script to rename table is shown below

The above query renames Person.Address to Addresses table. Refer to  to find table dependencies and rename the table there too.

Any object can also be renamed using GUI. Navigate to the object to rename and click F2 to rename it.

t sql script to rename table



Ahmad Osama

Like us on FaceBook Join the fastest growing SQL Server group on FaceBook

Follow me on TwitterFollow me on FaceBook