If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#11
|
|||
|
|||
"Jamie Collins" wrote in
oups.com: Essentially yes, although a CHECK constraint is more powerful than a Validation rule e.g. a CEHCK can reference other columns in the same row and columns in other tables. A validation rule _is_ a check constraint: the Access UI coverts a VR straight into a db rule. The only difference is that the UI still appears uses a primitive version of ADO/ DAO and using SQL- DDL directly does provide more functionality, but it's only a UI limitation. Why is this a 'short cut'? To me, usng a database schema to hardwire contraints that are purely abitrary is bad practice, and is a short cut round creating a proper table and suitable FK rules. At one end of the extreme would be a validation rule (qua check constraint like, "IN ('Red', 'Blue', 'White')", which would clearly be a disaster when the first yellow car came along. Close down the database, call in all the replications, run the DDL commands, recompile and reindex the database, reconnect front ends, hope the outside code still works, etc etc (okay, I am exaggerating, but you get the picture). Compare that with just adding one record to a table. At the other end of the extreme is an attribute like sex. There really is little chance of "IN ('M', 'F')" ever having to be changed in our lifetimes; but then again medical and surgical databases have to be able to handle Unknown, Both, UsedToBeOneAndNowIsTheOther and so on. In the end, db design is a skill as well as a technique -- the best designs are the ones that make the best compromises^W trade- offs between judicious short cuts and hopeless prolixity. But before doing that, you do need to have explored both the long way round and the short one in order to know what you lose or gain either way. All the best Tim F |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Replace table or table data in a database; keep relationships in t | Mack | General Discussion | 1 | February 24th, 2005 07:25 PM |
Update - If statement | Dan @BCBS | Running & Setting Up Queries | 13 | December 14th, 2004 07:02 PM |
Semicolon delimited text query help | Al Guerra | Running & Setting Up Queries | 3 | August 12th, 2004 11:50 AM |
Complicated Databse w/many relationships | Søren | Database Design | 7 | July 13th, 2004 05:41 AM |
Help with table design and relationships | Richard Wright | Database Design | 3 | June 20th, 2004 03:49 PM |