Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
j2dizzo
Starting Member
6 Posts |
Posted - 2004-07-05 : 15:17:15
|
| Below is a check constaint that I tried implementing by using trigger because SQL Server doesn't support subquery in check constraints but I don't know if the trigger will implement the same integrity as the check constraint. Here's it--- Check Constraint ---check((Derived_Val=0) or ((select count(*) from Stage_One where Task=U_Id and Quantity is null)=0))--- Trigger ---create trigger tr_Ins_Upd_Processon Processfor insert, update asif (select count(*) from Stage_One, insertedwhere ((Task=U_Id and Quantity is null)or(inserted.Derived_Val=0))) = 0beginrollback transactionendj2dizzo |
|
|
|
|
|