sp_rename

 
 

B. Renaming a column

The following example renames the TerritoryID column in the SalesTerritory table to TerrID.

USE AdventureWorks;
GO
EXEC sp_rename 'Sales.SalesTerritory.TerritoryID', 'TerrID', 'COLUMN';
GO

 

Leave a comment