How to Solve "Either the Parameter @Objname Is Ambiguous or the Claimed @Objtype (Column) Is Wrong."

How can I solve Either the parameter @objname is ambiguous or the claimed @objtype (COLUMN) is wrong.?

This works

EXEC sp_rename 
@objname = 'ENG_TEst."[ENG_Test_A/C_TYPE]"',
@newname = 'ENG_Test_A/C_TYPE',
@objtype = 'COLUMN'

Either the parameter @objname is ambiguous or the claimed @objtype (INDEX) is wrong

You need to give the full path of the index, as shown in the example in the documentation:

CREATE TABLE dbo.YourTable (ID int);
GO

CREATE UNIQUE INDEX IX_YourIndex ON dbo.YourTable (ID);
GO

EXEC sp_rename N'dbo.YourTable.IX_YourIndex',N'UX_YourIndex','INDEX'; --Schema, Table, Index
GO

DROP TABLE dbo.YourTable;

Either the parameter @objname is ambiguous or the claimed @objtype (OBJECT) is wrong In Code First Entity Framework

I fixed it by myself. I changed the migration class code and removed the unwanted and exceptional code. run migrations and updated database. It is resolved and working fine.

EF Migration : Either the parameter @objname is ambiguous or the claimed @objtype (COLUMN) is wrong

My problem was that for some reason, when I ran Create-Migration, it generated a command referencing a field in a table that didn't exist. Once I fixed that, it ran perfectly.

Rename SQL Column Error : Either the parameter @objname is ambiguous or the claimed @objtype (COLUMN) is wrong

This should solve your square bracket issue:

sp_RENAME 'dbo.File."[ARAInputJson]"' , 'ARAInputJson', 'COLUMN'

Entity Framework - migrations - @objname is ambiguous

I tried whay you said in my project which was using EF Core, I didn't get just RenameColumn in migration class, I got :

DropForeignKey(...) ,
DropIndex(...) ,
DropColumn(..)
and then AddColumn(...),
CreateIndex(...) and
CreateForeignKey(...)

and of course worked fine when I updated database.

But I searched for your issue , it seems SQL get confused somehow, the all solutions for problems like you, were saying use [] around tableName or ColumnName, it seems you have another name like these names and SQL can't specify them.

If you just tell me more about your entities before and after changes, I can follow your footstep and get error like you.



Related Topics



Leave a reply



Submit