I’m using Linq to SQL and some of my tables don’t have primary keys: this generates warnings. Is it a problem to have tables with no primary key?
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you’re only doing selects from your table, then technically no – there’s no problem with there being no primary key. But inserts, updates, and deletes will be problematic. The only reason I’ve found to not have PKs in your DBML is when you’re pointing at a view for readonly data access. But tables really should always have an officially declared primary key constraint.