Best Methods to Rename a Table in SQL Server

Jamey BartonJamey Barton
1 min read

Renaming tables in SQL Server seems simple, but there are quite a few things to keep in mind.

Yes, the basic method is using sp_rename:

EXEC sp_rename 'Schema.OldName', 'Schema.NewName';

But this doesn’t update references in views, stored procedures, or other dependent objects. That’s where it gets tricky.

For complex databases, it’s worth checking object dependencies beforehand and considering how renaming might affect other parts of the system. Sometimes it’s easier to use scripts when working with many tables or to handle renaming inside a transaction to avoid issues in high-concurrency environments.

Some tools (like dbForge Studio for SQL Server) can help by showing dependencies and letting you refactor names without breaking things.

Read this guide to learn more about the SQL Server rename table methods.

0
Subscribe to my newsletter

Read articles from Jamey Barton directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Jamey Barton
Jamey Barton

Data & Digital Enthusiast