Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options user 3847

A declarative mechanism such as a check or foreign key that enforces some data integrity rule in a database.

4
votes
In a nutshell, introduce d into the third table to enable vanilla foreign key constraints e.g. Transitional SQL-92 syntax: CREATE TABLE T1 ( a INTEGER NOT NULL, d INTEGER NOT NULL, UNIQUE (a, d) …
answered Dec 14 '11 by onedaywhen
3
votes
In a nutshell, create an ASSERTION to ensure that at no time can the business rule be violated e.g. Full Standard SQL-92 syntax: CREATE TABLE T1 ( a INTEGER NOT NULL, d INTEGER NOT NULL, UNIQUE …
answered Dec 15 '11 by onedaywhen
3
votes
Standard Transitional SQL-92, widely implemented e.g. SQL Server 2000 and above: Revoke 'writer' privileges from the table. Create two views for WHERE chk = 'Y' and WHERE chk = 'N' respectively, incl …
answered Oct 19 '11 by onedaywhen
1
vote
Standard FULL SQL-92: use a subquery in a CHECK constraint, not widely implemented e.g. supported in Access2000 (ACE2007, Jet 4.0, whatever) and above when in ANSI-92 Query Mode. Example code: note … CHECK constraints in Access are always table level. Because the CREATE TABLE statement in the question uses a row-level CHECK constraint, it needs to be amended slightly by adding a comma: create …
answered Oct 19 '11 by onedaywhen
2
votes
have confused at least one person answering here. Therefore, I suggest you omit it. To ensure the 'next to' relationship are stored uni-directional, add a CHECK constraint (or Validation Rule) e.g …
answered Jan 10 '12 by onedaywhen
6
votes
Possible approaches using widely implemented technologies: 1) Revoke 'writer' privileges on the table. Create CRUD procedures that ensure the constraint is enforced at transaction boundaries. 2 … . 3) Drop the CHAR(1) column. Add a seq integer column. Put a unique constraint on seq. Change the application semantics so that the considered 'default' is the row where the seq value is one or the seq value the largest/smallest value or similar. Possibly use views to encapsulate this logic. …
answered Oct 19 '11 by onedaywhen