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 |
csphard
Posting Yak Master
113 Posts |
Posted - 2006-10-24 : 13:08:11
|
I have a store procedure that returns data.I want to change the date monday through friday to spanishLunes to Viemes if the code is s for spanish.How can I check this in my store procedure.In oracle I could use decode. What can I do here |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-10-24 : 13:17:45
|
Make use of the CASE keyword.SELECT CASE WHEN MyColumn = 'S' THEN MyColumnInSpanish WHEN MyColumn = 'F' THEN MyColumnInFrench ELSE MyColumnInEnglish END AS TranslatedTextFROM MyTable Peter LarssonHelsingborg, Sweden |
 |
|
csphard
Posting Yak Master
113 Posts |
Posted - 2006-10-24 : 13:57:52
|
-- you were right -- Thanksselect language,case language when 'E' then 'Monday to Friday' when 'S' then 'Lunes to Viemes' END AS LANGUAGETYPEfrom dbo.TestTable |
 |
|
|
|
|