What can be done with errors of this kind or how to treat them? The code in the database can not be changed.

Error 6002: The primary key is not defined in the table / view. The key was drawn, and the table or view definition was created in read-only mode.

Error 6013: In the table / view 'view_name', the primary key is not specified and a valid primary key cannot be displayed. This table / view is excluded. To use an object, you will need to review your schema, add the correct keys and uncomment it.

Error 6005: The function "..." has the parameter "...", which has a data table type that is not supported.

  • Чтобы использовать объект, вам нужно будет просмотреть вашу схему, добавить правильные ключи и раскомментировать ее. - tym32167
  • @ tym32167, if you are talking about schemas in the database, you cannot change it, the desktop still depends on it! - Yaroslav
  • @ tym32167, can you somehow fix it through the Entity Framework, without touching the base? - Yaroslav

1 answer 1

There is only one solution:

 SELECT CAST((ROW_NUMBER() OVER (ORDER BY X.XXX)) AS INT) AS EDMXID FROM XXX AS X;