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 |
|
7siva7
Starting Member
28 Posts |
Posted - 2011-11-24 : 03:22:22
|
| DECLARE @TestVal int,@Val varchar(30)SET @TestVal = 3SELECT CASE @TestVal WHEN 1 THEN 'First' WHEN 2 THEN 'Second' WHEN 3 THEN 'Third' ELSE 'Other' ENDthe above code prints "Third"but i want to store it in another variable @Valhow can i store it select @Val =(case.....) not workingplease help meHI |
|
|
7siva7
Starting Member
28 Posts |
Posted - 2011-11-24 : 03:24:41
|
| Sorry ...Working fine //// :)HI |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2011-11-24 : 06:15:49
|
| Have you used this?SELECT @val=CASE @TestValWHEN 1 THEN 'First'WHEN 2 THEN 'Second'WHEN 3 THEN 'Third'ELSE 'Other'ENDMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|