How to: Rename Columns

The column name property of a column shows the name of the column as it is stored in the database. You can rename a column directly in your table in Table Designer and the database will be updated with the new name when you save the table.

Note

A new version of Table Designer appears for databases in the SQL Server 2012 format. This topic describes the old version of Table Designer, which you use with databases in earlier formats of SQL Server.

In the new version, you can change a table definition through a graphical interface or directly in a script pane. If you use the graphical interface, the table’s definition is automatically updated in the script pane. To apply the SQL code in the script pane, choose the Update button. For more information about the new version, see How to: Create Database Objects Using Table Designer.

Warning

Renaming a column may affect dependent triggers, stored procedures, and constraints. Consider renaming a column before you create these other objects. For more information about these database objects, see Database Objects.

Note

Your computer might show different names or locations for some of the Visual Studio user interface elements in the following instructions. The Visual Studio edition that you have and the settings that you use determine these elements. For more information, see Customizing Development Settings in Visual Studio.

To rename a column

  1. In Server Explorer, right-click the table with columns you want to rename and click Open Table Definition.

    The table opens in Table Designer.

  2. Under Column Name, select the name you want to change and type a new one.

The column is renamed in your table as soon as you exit the cell. The column is renamed in your database when you save the table.

Note

You can also change the name in the Column Properties tab. Select the column whose name you want to change and type a new value for Name.

See Also

Reference

Column Properties

Other Resources

Working with Columns