0

In my sql table, I am not able to set the primary key for views. When I try to compile my project, I always get he error. Is there a way to set the primary key in sql server, or in Visual Studio to make this error go away?

Warning 2 Error 6002: The table/view 'db.dbo.View_Customer_Active' does not have a primary key defined. The key has been inferred and the definition was created as a read-only table/view. C:\Users\Documents\Visual Studio 2013\Projects\Proj1\Proj1\Models\DB.edmx

user1929393
  • 4,089
  • 7
  • 30
  • 48

1 Answers1

1

It's not an error, but just a warning that tells you that you cannot update and delete items from the view. Views without primary keys is kind of frequently asked question in the context of Entity Framework:

Entity Framework: View exclusion without primary key or Entity Framework and SQL Server View

Community
  • 1
  • 1
takemyoxygen
  • 4,294
  • 22
  • 19