Total Pageviews

Change the Column Name


With the help of "sp_RENAME" system stored procedure, we can change the name of column in table.
Below is the syntax:-

sp_RENAME 'TableName.[OldColumnName]' , '[NewColumnName]', 'COLUMN'

Let's have an example:-

Create a table and have a look into the schema of table:-



Now with the help of sp_RENAME system stored procedure, we rename the column name from "id" to "emp_id" as below:-














 

No comments:

Post a Comment