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_Process
on Process
for insert, update as
if (select count(*) from Stage_One, inserted
where ((Task=U_Id and Quantity is null)or(inserted.Derived_Val=0))) = 0
begin
rollback transaction
end

j2dizzo