SOLVED: Either the parameter @objname is ambiguous or the claimed @objtype (COLUMN) is wrong.

After making some (of in fact a lot of) changes to my persistent classes I get the error: Either the parameter @objname is ambiguous or the claimed @objtype (COLUMN) is wrong.

I’m using Entity Framework 6, code first and automatic migrations.

How did I solve this:

– run in the package manager console : update-database -verbose -sourcemigration $initialdatabase

Now you can see what is causing the migration to fail. In my case it was changing a one-many relationship to a many-to-many using a extra (explicit) linking table.

Remark: often the issue is with foreignkey  and relationships. Since you perhaps try to modify the relationships, it could be necessary to modify of delete the related data, so SQL server can delete and recreate references on empty tables

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>