Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding Rows and Constraints
Message
From
14/08/2003 12:58:51
 
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
00819978
Message ID:
00820225
Views:
23
Hi Rick,

This is an often-debated issue. At first it seemed to me that the database was such a good place to store basic data rules, but for FWIW, I have decided that I need more flexibility and I currently put as few rules as possible with the data itself, only what is necessary to maintain basic data integrity, such as no orphaned records. In reality, I find it necessary to orphan records and assign them to an orphan foreign key so the database doesn't know they are orphaned. <g>

The more of this I do, the more I find there aren't many hard-and-fast enough rules to commit them to the database beyond primary and candidate keys and persistant relations.

That said, I think Stephen has the right idea for dealing with database constraints. You can get around nulls by having appropriate dummy value the the constraints can recognize and accept. I don't know a way around the unique pk issue and I am not sure you want to go there. It seems to me that if you want to get the data onto the server, that you at least want to supply the necessary key values so the records are related correctly. But then you didn't share why you need to go directly to the server data.

pamela
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform