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

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.

你可能感兴趣的:(sqlserver,版本控制)