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
How to Reset an MySQL Autoincrement Using a Max Value from Another Table
How to Store More Than 255 Char in MySQL Database
Join to Only the "Latest" Record with T-Sql
How to Make a Table Read Only in SQL Server
How to Create a Closure Table Using Data from an Adjacency List
Key/Value Pairs in a Database Table
How to Write a Conditional in a MySQL Select Statement
Select Columnvalue If the Column Exists Otherwise Null
Differencebetween a Primary Key and a Unique Constraint
Oracle SQL Where Clause to Find Date Records Older Than 30 Days
Join Two Spreadsheets on a Common Column in Excel or Openoffice
Regular Expressions Inside SQL Server
Count Rows Per Hour in SQL Server with Full Date-Time Value as Result
Are There Any Free Tools to Generate 'Insert Into' Scripts in Ms SQL Server