Search code examples
sqlsql-server-2014

Change column name in SQL Server 2014


How to change the column name in SQL Server 2014 using query?


Solution

  • For this you can use this query

    USE DATABASE;  
    GO  
    EXEC sp_rename 'TABLE.COLUMN_NAME', 'COLUMN_NEW_NAME', 'COLUMN';  
    GO
    

    You will have to replace DATABASE,TABLE,COLUMN_NAME and COLUMN_NEW_NAME with your data