question,database,level,enforced,constraints,
Quick Search for:  in language:    
question,database,level,enforced,constraints,
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
SQL Stats

 Code: 31,203 lines
 Jobs: 364 postings

 
Sponsored by:

 

You are in:

 
Login



Latest Code Ticker for SQL
To display a name in a default language if the given one doesn't exist
By Serge Alard on 10/18


Order by column except a few values
By Serge Alard on 10/18


Introduction to PL/SQL (Series 3) Cursors
By David Nishimoto on 10/14


Sorting a String using T-SQL
By Gaurav Pugalia on 10/12


Protecting against TSQL virii, worms and time bombs
By Joseph Gama on 10/11


Click here to see a screenshot of this code!Get size in bytes of SP, View, Trigger, UDF or Rule
By Joseph Gama on 10/11

(Screen Shot)

Extended stored procedure tutorial part I
By Joseph Gama on 10/10


Click here to see a screenshot of this code!Rijndael Encryption SP’s/UDF’s with TSQL calling activeX
By Joseph Gama on 10/10

(Screen Shot)

Click here to see a screenshot of this code!RC4 Encryption SP’s/UDF’s with TSQL calling activeX
By Joseph Gama on 10/10

(Screen Shot)

Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!





Affiliate Sites



 
 
   

Got constraints? ERP does not.

Print
Email
 

Submitted on: 7/11/2000 11:08:28 PM
By: Steven Hauser  
Level: Beginner
User Rating: By 1 Users
Compatibility:SQL Server 7.0, Informix , Oracle, Other

Users have accessed this article 3834 times.
 
 
     The question of database level enforced constraints vs programmer applied constraints is asked occasionally by people who have not done much database development work.

 
 
Terms of Agreement:   
By using this article, you agree to the following terms...   
1) You may use this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this article from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the article or article's description.
Choose database level constraints where possible. Integrity 
constraints (foreign keys), check constraints (attribute domains) 
take work out of the programmers head space. It stops data from
getting scrambled.
 Any programmer who thinks about it will come to the same conclusion.
 For example, great wads of code written to check that an orderline is 
attached to an order becomes worthless if one error pops up anywhere or anytime in any application that touches the data. 
 It doesn't matter how good one programmer is if another idi0t gets 
in there and scrambles the data. Maintenance on programs goes for 
decades. And I never met a programmer that didn't think everyone 
else is an idi0t. 
 ERP applications such as Baan, PeopleSoft and SAP end up costing 
companies huge overhead to straighten out the "programmer enforced" 
constraints.
 It is one of the dirty secrets of ERP. Most of the processing that 
happens in ERP batch jobs seems to be 'fixing' the problems
brought about by bad design, old code and non-RDBMS based
architecture which fails to use database level constraints.
 The only place to use programmed constraints is where shared data
is treated differently in separate applications. In that case shared
constraints are still enforced by the database but application specific
constraints have to be handled per application.
 For testimonials just ask people who "clean" data for
loading into a data warehouse which type of database they would
rather load from....


Other 13 submission(s) by this author

 

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this article(in the Beginner category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
9/26/2001 4:47:42 PM:AngryBuddha
Nice explanation Steve.... I hope the prgrammers are paying attention ;)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this article has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular article, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | SQL Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.