SQL SERVER – How to Rename a Column Name or Table Name

This article gives two syntax’s of renaming database object.

  1. Renaming database table column to new name.
  2. Renaming database table to new name.

The script for renaming any column :
sp_RENAME 'TableName.[OldColumnName]' , '[NewColumnName]', 'COLUMN'

 The script for renaming any object (table, sp etc) :
sp_RENAME '[OldTableName]' , '[NewTableName]'