Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Rename Tables (Database Engine)

Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).

You can rename a table in SQL Server 2016 by using SQL Server Management Studio or Transact-SQL.

Caution note Caution

Think carefully before you rename a table. If existing queries, views, user-defined functions, stored procedures, or programs refer to that table, the name modification will make these objects invalid.

In This Topic

Limitations and Restrictions

Renaming a table will not automatically rename references to that table. You must manually modify any objects that reference the renamed table. For example, if you rename a table and that table is referenced in a trigger, you must modify the trigger to reflect the new table name. Use sys.sql_expression_dependencies to list dependencies on the table before renaming it.



Requires ALTER permission on the table.

Arrow icon used with Back to Top link [Top]

To rename a table

  1. In Object Explorer, right-click the table you want to rename and choose Design from the shortcut menu.

  2. From the View menu, choose Properties.

  3. In the field for the Name value in the Properties window, type a new name for the table.

  4. To cancel this action, press the ESC key before leaving this field.

  5. From the File menu choose Save table name.

Arrow icon used with Back to Top link [Top]

To rename a table

  1. In Object Explorer, connect to an instance of Database Engine.

  2. On the Standard bar, click New Query.

  3. The following example renames the SalesTerritory table to SalesTerr in the Sales schema. Copy and paste the following example into the query window and click Execute.

    USE AdventureWorks2012; 
    EXEC sp_rename 'Sales.SalesTerritory', 'SalesTerr';

For additional examples, see sp_rename (Transact-SQL).

Arrow icon used with Back to Top link [Top]

Community Additions

© 2015 Microsoft