当前位置: 代码迷 >> Sql Server >> sqlserver2000 修改列名字,该如何解决
  详细解决方案

sqlserver2000 修改列名字,该如何解决

热度:75   发布时间:2016-04-27 21:03:37.0
sqlserver2000 修改列名字
alter   table   table_name   rename   column   oldname   to   newname
column出错
是这样写的吗,我怎么在帮助里没找到rename的解释阿

------解决方案--------------------
A. 重命名表
下例将表 customers 重命名为 custs。

EXEC sp_rename 'customers ', 'custs '

B. 重命名列
下例将表 customers 中的列 contact title 重命名为 title。

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

  相关解决方案