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
 Please help me

Author  Topic 

boreddy
Posting Yak Master

172 Posts

Posted - 2009-06-30 : 08:29:49
I have table like this

Id int not null ,
Day1 bit null,
day2 bit null,
day3 bit null

i need to write check constraint based on day1,day2,day3
the condition is at least one column should be not null
how can i write check constrint

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-06-30 : 08:33:12
day1 is not null or day2 is not null or day3 is not null

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

boreddy
Posting Yak Master

172 Posts

Posted - 2009-06-30 : 08:48:47
thank you
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-06-30 : 13:02:01
why keep a seperate column for each day? is it better to keep single bit field and day as another column?
Go to Top of Page
   

- Advertisement -