|
|
|
|
Browse by Tags
All Tags » Data Integrity » Database Programming (RSS)
-
I will demonstrate how use constraints to make sure that
intervals of time have no overlaps. Also you may ensure that there are no gaps
either, but if you choose to allow gaps, then the query to retrieve them is
very easy. As discussed in my previous posts, you can also use triggers or UDFs
wrapped in CHECK constraints, but only trusted ...
-
Calculating running totals is notoriously slow, whether you
do it with a cursor or with a triangular join. It is very tempting to denormalize,
to store running totals in a column, especially if you select it frequently.
However, as usual when you denormalize, you need to guarantee the integrity of
your denormalized data. Fortunately, you can ...
-
You cannot use CHECK constraints to compare columns in different
rows or in different tables, unless you wrap such functionality in scalar UDFs
invoked form a CHECK constraint. What if you actually need to compare columns
in different rows or in different tables to enforce a business rule? For
example, suppose that you know working hours of ...
|
|
|
|
|