sql modify column names and table names

Code is as follows:
EXEC the sp_rename 'table [original column name].', 'A new column name', 'column'

************************************************** ***********************
Transact-SQL reference

sp_rename
change the current user to create objects in the database (e.g., tables, columns, or user-defined data type) name.

Example
A. rename table
following example rename table customers custs.

EXEC sp_rename 'customers', 'custs' 

Rename column B.
The following example listed in the table customers contact title Rename title.

EXEC sp_rename 'customers.[contact title]', 'title', 'COLUMN' 

***********

And modify the database name is used

sp_renamedb [ @dbname = ] 'old_name' , [ @newname = ] 'new_name'

Reproduced in: https: //www.cnblogs.com/henryhappier/archive/2010/01/25/1656165.html

Guess you like

Origin blog.csdn.net/weixin_33802505/article/details/93537479