如何用sql语句删除数据表中的字段,并且给另外一个字段改名?

多谢了。
我用alter table drop col_name 不行,提示说col_name 不是约束.
该字段中是有内容的,怎么解决呢?
---------------------------------------------------------------

ALTER TABLE yourtable DROP COLUMN col_name
---------------------------------------------------------------

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

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

Published At
Categories with 数据库类
Tagged with
comments powered by Disqus