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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 conditional constraint

Author  Topic 

maverik_vz
Starting Member

1 Post

Posted - 2009-05-28 : 04:39:08
I'm having problem finding solution for constraint:
Table has 2 columns, condition and date. Condition is binary and, if it is 1, you have to enter the date. If ii is 0, you can't enter the date.
How could I solve this using constraints?

Thanks!

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-05-28 : 12:02:46
do you mean to say that if condition is 0,date should be null or is it that if its 0 date value shouldnt be allowed to update? if its latter, then what you need is an instead of update trigger.
Go to Top of Page
   

- Advertisement -