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 |
|
sqlpal2009
Yak Posting Veteran
58 Posts |
Posted - 2009-08-20 : 12:33:42
|
Hello All,How should eliminate the error in below code? If the @SeqID parameter is NULL then I want sequenceID = 1 else @SeqID and 1.SELECT *FROM TWHERE Ports = @ProtName ANDCASE WHEN ISNULL(@SeqID,'') = '' THEN sequenceID = 1 ELSE sequenceID IN (@SeqID, 1) END Thanks,-S |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-08-20 : 12:48:26
|
SELECT *FROM TWHERE Ports = @ProtName ANDsequenceID IN (isnull(@SeqID,1), 1) No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
sqlpal2009
Yak Posting Veteran
58 Posts |
Posted - 2009-08-20 : 12:55:15
|
| If @SeqID is not null then sequenceID IN (@SeqID, 1) else sequenceID = 1 |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-08-20 : 12:58:07
|
Yes!? No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|
|