Rename column SQL Server 2008(修改字段名)

来源:互联网 发布:生刷枪软件下载 编辑:程序博客网 时间:2024/06/06 09:25

I am using SQL Server 2008 and navicat. I need to rename a column in a table using SQL.

ALTER TABLE table_name RENAME COLUMN old_name to new_name;

This statement doesn’t work.

For your case it would be:

EXEC sp_RENAME 'table_name.old_name', 'new_name', 'COLUMN'

Remember to use single quotes to enclose your values.

0 0
原创粉丝点击