February 11, 2010 at 10:22 am
Hi Folks
is there anyway to incorporate a CASE statement with SERVERPROPERTY such as in the example (that does not work) below ?
Thanks
Jim
-------------
select
CAST (SERVERPROPERTY('EngineEdition') as varchar (20)) AS 'EngineEdition',
CASE SERVERPROPERTY('EngineEdition')
WHEN '1' THEN 'Personal/Desktop'
WHEN '2' THEN 'Standard/Workgroup'
WHEN '3' THEN 'Enterprise/Evaluation/Developer'
WHEN '4' THEN 'Express/Advanced Services/Embeded SQL'
ELSE
'Unknown EngineEdition'
END SERVERPROPERTY('EngineEdition')
go
February 11, 2010 at 10:25 am
Try this:
select case (select serverproperty('engineedition'))
WHEN '1' THEN 'Personal/Desktop'
WHEN '2' THEN 'Standard/Workgroup'
WHEN '3' THEN 'Enterprise/Evaluation/Developer'
WHEN '4' THEN 'Express/Advanced Services/Embeded SQL'
ELSE
'Unknown EngineEdition'
END as Engine
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
February 11, 2010 at 10:44 am
I'd do what Gus has listed.
February 11, 2010 at 11:00 am
Hi GSquared
thanks very much, it worked
i did have to take the quotes off the numbers as the value is integer (my fault)
other than that, BEAUTIFUL !
Appreciate it
Jim
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply