dbTalk Databases Forums  

Constraints or assertions

comp.databases.theory comp.databases.theory


Discuss Constraints or assertions in the comp.databases.theory forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
AK
 
Posts: n/a

Default Constraints or assertions - 05-05-2009 , 09:09 AM






I have posted a few ideas on implementing business rules in the
database:

http://sqlblog.com/blogs/alexander_k...ql-server.aspx

I am very interested in feedback.

Cheers,

Alex Kuznetsov,
SQL Server MVP

Reply With Quote
  #2  
Old   
Roy Hann
 
Posts: n/a

Default Re: Constraints or assertions - 05-05-2009 , 09:51 AM






AK wrote:

Quote:
I have posted a few ideas on implementing business rules in the
database:

http://sqlblog.com/blogs/alexander_k...ql-server.aspx

I am very interested in feedback.
So you really just want general constraints like in ANSI/ISO SQL92.
The standard syntax is CREATE ASSERTION.

I agree that any SQL DBMS would benefit from the ability to enforce
general constraints.

--
Roy




Reply With Quote
  #3  
Old   
Bob Badour
 
Posts: n/a

Default Re: Constraints or assertions - 05-05-2009 , 10:39 AM



Roy Hann wrote:

Quote:
AK wrote:

I have posted a few ideas on implementing business rules in the
database:

http://sqlblog.com/blogs/alexander_k...ql-server.aspx

I am very interested in feedback.

So you really just want general constraints like in ANSI/ISO SQL92.
The standard syntax is CREATE ASSERTION.

I agree that any SQL DBMS would benefit from the ability to enforce
general constraints.
There is that, but I was also going to suggest the OP read the
Lorentzos/Date/Darwen book on Temporal Data.

The specific example he gave involves foreign key references to an
interval data type--one for which the DURING keyword might seem strange
from an english perspective but perfectly acceptable from a formal
perspective.


Reply With Quote
  #4  
Old   
Philipp Post
 
Posts: n/a

Default Re: Constraints or assertions - 05-06-2009 , 04:08 AM



Quote:
I have posted a few ideas on implementing business rules in the database:
I would appreciate CREATE ASSERTION statements too. This would be a
more genric tool than putting this into a FOREIGN KEY constraint. Not
all the rules you might want to enforce involve a foreign key. Also
this would be according to the SQL standard.

To allow subqueries (also from diff. tables) in CHECK constraints
would also be interesting.

brgds

Philipp Post



Reply With Quote
  #5  
Old   
--CELKO--
 
Posts: n/a

Default Re: Constraints or assertions - 05-06-2009 , 08:24 AM



Quote:
So you really just want general constraints like in ANSI/ISO SQL92. The standard syntax is CREATE ASSERTION.
A quick comment, SQL-92 allows CHECK() constraints to have any valid
search condition, evern those that referencs other tables or its own
table at aggregate levels. But all CHECK() constraints are TRUE for
an empty table.

The reason we defined the CREATE ASSERTION was that it is at the
schema level and it works with empty tables. This is why CHECK()
constraint names are global to the schema.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.