Tuesday, March 27, 2012

Determine Processor Architecture for SQL Server 2005

Determine Processor Architecture for SQL Server 2005

I like the new features in SERVERPROPERTY but there's a huge, glaring oversight in my opinion: it doesn't return the processor architecture. I'm trying to write a detailed server info collection script and (1) use only TSQL, and (2) have it return the processor architecture. Here's what I have so far:

SELECT
SERVERPROPERTY('InstanceName') AS [InstanceName]
, SERVERPROPERTY('ServerName') AS [ServerName]
, @.@.VERSION AS Version
, CASE
WHEN CHARINDEX('Intel X86',@.@.VERSION)<>0 THEN '32-bit'
WHEN CHARINDEX('Intel IA-64',@.@.VERSION)<>0 THEN '64-bit'
-- WHEN CHARINDEX('x86-64',@.@.VERSION)<>0 THEN '64-bit'
-- WHEN CHARINDEX('AMD64',@.@.VERSION)<>0 THEN '64-bit'
-- WHEN CHARINDEX('WOW64',@.@.VERSION)<>0 THEN 'WOW64'
-- WHEN CHARINDEX('AMD64',@.@.VERSION)<>0 THEN 'WOW32'
ELSE 'Unknown'
END AS ProcessorArchitecture

The problem is that I can only include the architectures that I've worked on (X86 and IA-64). The documentation does nothing to give us any clue what the values from @.@.VERSION will possibly return. I've made some guesses (in comments) but I haven't installed these so I'm not positive they are the right values returned by @.@.VERSION.

Anyone have confirmation of other architectures returned by @.@.VERSION? Or, even better, does anyone have a better TSQL-only way of returning this info?

Thanks!

Scott Whigham

Take a look at xp_msver.|||

xp_msver is not really any better/different than @.@.VERSION, is it? Actually I like @.@.VERSION better since I can use it in a query along with the other SERVERPROPERTY properties. Thanks though :) And it's weird that xp_msver and @.@.VERSION report the architecture using different values. That's a big incongruous to me.

Anyone else have other values or can confirm the values I posted?

No comments:

Post a Comment