MyNguyen
MyNguyen

Reputation: 339

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 . 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.

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?

Upvotes: 1

Views: 152

Answers (1)

Rahul
Rahul

Reputation: 77866

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."?

Upvotes: 1

Related Questions