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 |
|
mrm23
Posting Yak Master
198 Posts |
Posted - 2010-04-22 : 09:16:56
|
| Hi All,I know this is silly but i am not able to correct it :(i have a syntax error near '='.DECLARE @Salutation SMALLINTSET @Salutation = SELECT CASE WHEN @Gender = 0 THEN 1 WHEN @Gender = 1 THEN 2 ELSE 1 ENDPlease give me the correct syntax |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-04-22 : 09:18:48
|
| DECLARE @Salutation SMALLINTSET @Salutation = (SELECT CASE WHEN @Gender = 0 THEN 1WHEN @Gender = 1 THEN 2 ELSE 1 END)MadhivananFailing to plan is Planning to fail |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-04-22 : 09:19:41
|
| orDECLARE @Salutation SMALLINTSET @Salutation = (SELECT CASE WHEN @Gender = 1 THEN 2 ELSE 1 END)MadhivananFailing to plan is Planning to fail |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-04-22 : 09:20:19
|
SET @Salutation = CASE WHEN @Gender = 0 THEN 1WHEN @Gender = 1 THEN 2 ELSE 1 END No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
mrm23
Posting Yak Master
198 Posts |
Posted - 2010-04-22 : 09:21:31
|
| Oops! it was indded a silly mistake! Sorry.... |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-04-22 : 09:34:54
|
No problem We all know situations like this. No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|
|