To rename a column using Object Explorer
In Object Explorer, connect to an instance of Database Engine.
In Object Explorer, right-click the table in which you want to rename columns and choose Rename.
-
To rename a column using Table Designer
In Object Explorer, right-click the table to which you want to rename columns and choose Design.
Under Column Name, select the name you want to change and type a new one.
On the File menu, click Save table name.
To rename a column using T-SQL
EXEC sp_rename 'TableName.OldColumnName', 'NewColumnName', 'COLUMN';
EXEC sp_rename 'Sales.Employee.EployeeJobId', 'JobID', 'COLUMN';
Comments
Post a Comment