1
votes

I am using this command:

dnx ef dbcontext scaffold "Server=webuat08,1433,Database=Store;user    
id=user_here;password=password_here" EntityFramework.MicrosoftSqlServer

The database "Store" exists. But I am getting the following error:

Unable to identify the primary key for table 'dbo.spt_fallback_db'.
Unable to generate entity type for table 'dbo.spt_fallback_db'.
Unable to identify the primary key for table 'dbo.spt_fallback_dev'.
Unable to generate entity type for table 'dbo.spt_fallback_dev'.
Unable to identify the primary key for table 'dbo.spt_fallback_usg'.
Unable to generate entity type for table 'dbo.spt_fallback_usg'.
Could not find type mapping for column 
'dbo.MSreplication_options.optname'     with data type 'sysname'. Skipping column.
Unable to identify the primary key for table 'dbo.MSreplication_options'.
Unable to generate entity type for table 'dbo.MSreplication_options'.
Unable to identify the primary key for table 'dbo.spt_monitor'.
Unable to generate entity type for table 'dbo.spt_monitor'.
Done

If I change the name of the Database in the command to a DB that doesn't exist I still get the same error. Any ideas?

1
Can you share your schema e.g. the SQL you used to create your tables?natemcmaster

1 Answers

0
votes

You need to put the primary key in your tables