我正在尝试重命名已创建的表中的一些列:
USE AdventureWorks
GO
EXEC sp_RENAME 'registration.StudentID', 'Temp', 'COLUMN';
GO
但我收到此错误消息:
Either the parameter @objname is ambiguous or the claimed @objtype (COLUMN) is wrong.
如果我省略“COLUMN”,则会出现此错误:
No item by the name of 'registration.StudentID' could be found in the current database 'AdventureWorks', given that @itemtype was input as '(null)'.
我非常确定 StudentID
列存在并且其中包含数据。谁能帮我吗?谢谢!!!
最佳答案
根据评论,这就是您所需要的。
USE registration;
EXEC sp_rename 'dbo.enrollment.StudentID', 'Temp', 'COLUMN';
关于sql-server-2008 - SQL Server - 重命名列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13374605/