Tuesday, 29 September 2015

How to rename the existing column in SQL server?

After the Column creation ,it is also possible to change the column name in SQL server.

Syntax : 

SP_RENAME '[TABLE NAME].[EXISTING COLUMN NAME]','[NEW COLUMN NAME]','COLUMN'

Example :

SP_RENAME 'Student.StudentAddress','StudentAdd','Column'


Now the Column name will be changed from StudentAddress to StudentAdd in Student table.

No comments:

Post a Comment