简体   繁体   English

在 Sql Server 中重命名列时表名不明确

[英]Ambigous table's name when rename column in Sql Server

I have a problem related to the name of table.我有一个与表名有关的问题。 I have a table with name AA.Transaction .我有一个名为 AA.Transaction 的表。 I want to rename a column in that table我想重命名该表中的一列

EXEC sp_rename N'AA.[Transaction].Reference', N'CustomerReference', 'COLUMN';  

And i got an error我有一个错误

Either the parameter @objname is ambiguous or the claimed @objtype (COLUMN) is wrong.参数@objname 不明确或声明的@objtype (COLUMN) 是错误的。

I realized that the problem is the name of the table (Transaction).我意识到问题是表的名称(事务)。 If i use another table's name, the script work well.如果我使用另一个表的名称,则脚本运行良好。

How i can solve this problem?我该如何解决这个问题?

Either remove the [] or make it like删除[]或使其像

EXEC sp_rename N'[AA].[Transaction].[Reference]', N'CustomerReference', 'COLUMN';

Check this post once: How can i solve "Either the parameter @objname is ambiguous or the claimed @objtype (COLUMN) is wrong."?检查此帖子一次: 如何解决“参数@objname 不明确或声称的@objtype (COLUMN) 错误。”?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM