Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
I was trying to enter a constraint expression into the dialog box. I have three fields of the data type "bit". I want to make sure that of the three, only one equals "1". Using the documentation I found in Books Online, I attempted to use the following expression, but it would not validate.(expert == 1 && supplier == 0 && employee == 0) || (expert == 0 && supplier == 1 && employee == 0) || (expert == 0 && supplier == 0 && employee == 1)Can someone please assist me in getting this corrected?- - - -- Will -- - - -http://www.strohlsitedesign.comhttp://www.servicerank.com/
snSQL
Master Smack Fu Yak Hacker
1837 Posts
Posted - 2007-03-20 : 15:40:12
You're using C# (or C++, or Java) syntax, not Transact-SQL syntax, you want to use this,(expert = 1 AND supplier = 0 AND employee = 0) OR (expert = 0 AND supplier = 1 AND employee = 0) OR (expert = 0 AND supplier = 0 AND employee = 1)
hismightiness
Posting Yak Master
164 Posts
Posted - 2007-03-20 : 15:47:09
Hmmm... I thought the syntax was odd. The documentation didn't specify the language. I just checked again. :(Thank you so much for your help. It worked!- - - -- Will -- - - -http://www.strohlsitedesign.comhttp://www.servicerank.com/
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)