Home / Software / Tips and Tricks / How Rename a Column or Table in SQL SERVER

How Rename a Column or Table in SQL SERVER

Updated:  07/14/2010 13:07 PM
Author:  Shiju Mathews

Status:    Resolved.


A table name can be changed by using sp_RENAME function

Transact-SQL Syntax :



Where 'object_type' is the type of object being renamed. object_type is varchar(13), with a default of NULL, and can be one of these values. The Values for 'object_type' are

Value Description
COLUMN A column to be renamed.
DATABASE
INDEX A user-defined index.
OBJECT An item of a type tracked in sys.objects. For example, OBJECT could be used to rename objects including constraints (CHECK, FOREIGN KEY, PRIMARY/UNIQUE KEY), user tables, and rules.
USERDATATYPE An alias data type or CLR User-defined Types added by executing CREATE TYPE or sp_addtype.


The script for renaming any object (database, table, sp etc) :





The script for renaming any column



Rank Name Value in $
Change in
1 Hr 24 Hrs 1 Week
1 Bitcoin (BTC) 11660.1 1.29 3.84 -15.62
2 Ethereum (ETH) 1050.25 1.19 5.3 -13.5
3 Ripple (XRP) 1.62773 1.53 17.42 -20.42
4 Bitcoin Cash (BCH) 1825.68 2.22 2.26 -28.04
5 Cardano (ADA) 0.649367 2.0 4.6 -9.66
6 Litecoin (LTC) 194.45 1.6 6.47 -17.38
7 NEM (XEM) 1.06579 0.59 4.23 -22.52
8 NEO (NEO) 143.923 2.44 5.63 22.02
9 Stellar (XLM) 0.515847 1.73 7.71 -19.78
10 IOTA (MIOTA) 2.83619 0.94 4.39 -18.35
Join CoinBase (Referal Link)
Jan 19 2018 1:59AM