How to Rename a Table in SQL Server in SQL Server

Renaming a table in SQL Server is performed by using SP_RENAME stored procedure:

--the syntax
exec sp_rename  'old_table_name',  'new_table_name';

--rename users_marketing to users table
exec sp_rename  'users_marketing',  'users';

Previous

Next

Ready for a modern SQL editor?