February 2, 2009 at 8:39 am
Currently the job I am at has set up primary keys that are not logical instead they are one field guids in every table. Then they would handle all unique logic in code. I obviously had an issue with this, but I want to make sure my solution is correct. Since they do all selects/updates/deletes by that guid field that is the non clustered PK. What I have done is add unique indexes to preserve data integrity within the DB. Thing is that an index requires space and the only time those indexes will be used is when checking unique. Is this a good solution for a messed up way to set up tables? Is there a way to do a constraint without requiring storage. most of these constraints are multiple fields.
February 2, 2009 at 8:47 am
In SQL 2005, unique constraints are enforced by an index, so there's no gain to that.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply