How to Rename a Table in SQL Server
Last updated July 25, 2026 · By the SaturnSQL team
Use EXEC sp_rename 'old_name', 'new_name'. Schema-qualify only the old name; the new name must be a bare identifier, because brackets or a schema prefix become a literal part of the new table name.
EXEC sp_rename 'dbo.orders', 'customer_orders';Quoting gotcha
sp_rename treats the new name literally. Passing '[customer_orders]' creates a table actually named [customer_orders], brackets included. Only quote the old name, and only when it needs it.
-- Wrong: creates a table literally named [customer_orders]
EXEC sp_rename 'dbo.orders', '[customer_orders]';Renaming does not update references: views, stored procedures, and triggers that mention the old name keep the old text and break until you alter them.
Run this in SaturnSQL
SaturnSQL is a browser-based SQL editor for teams: shared query library, schema-aware autocomplete, and scheduled exports to Google Sheets and Slack.
Try it free