When you specify a PRIMARY KEY constraint for a table, Microsoft® SQL Server™ 2000 enforces data uniqueness by creating a unique index for the primary key columns. This index also permits fast access to data when the primary key is used in queries.
I'm using some .Net code (that I can't change) which requires tables to have a primary key. I would like to use a view, but can't because I don't know how to assign a primary key. I just want to know if it's possible.
Cheers
Jon
"I don't regret this, but I both rue and lament it.
Do all the tables in the view have a primary key? Then just use the SQl that the view uses instead of the view. You can't put primary keys on anything except tables.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.