参考SQL Server联机丛书的 sp_renamedb与sp_rename
一、更改数据库名
二、更改表名或列名
![]()
sp_rename [ @objname = ] ' object_name ' ,
![]()
[ @newname = ] ' new_name '
![]()
[ , [ @objtype = ] ' object_type ' ]
![]()
![]()
/////////////////////////////////////////////
![]()
A. 重命名表
![]()
下例将表 customers 重命名为 custs。
![]()
![]()
EXEC sp_rename ' customers ' , ' custs '
![]()
B. 重命名列
![]()
下例将表 customers 中的列 contact title 重命名为 title。
![]()
![]()
EXEC sp_rename ' customers.[contact title] ' , ' title ' , ' COLUMN '
【转自:http://www.cnblogs.com/tenor/archive/2008/01/07/1029386.html】