Home > T-sql, VM > What’s my OS bit LEVEL 32 or 64

What’s my OS bit LEVEL 32 or 64

recently I needed to check OS level of few servers   most servers in my environment , I was looking for query I could run from

CMS .. to get a consolidated CentralManagementServerdata from all servers .

I got an initial idea from link .. A big Thanks to Thomas LaRock

I had few servers where DMV or 2005 + onwards features or tables where

not available .. so I have modified Thomas’s script a bit to suit my needs

below script can be RAN on CMS or individual SQL server

output will have Servername, OS bit level,SQL bit level and whether Server

is VM (works for Hypervisor or VM) or Physical

SELECT

@@servername ‘Servername’,

case

when RIGHT(SUBSTRING(@@VERSION,CHARINDEX(‘<‘,@@VERSION), 4), 2)like ’64’ then ’64’

else ’32’

END ‘OS TYPE’,

case

when RIGHT(SUBSTRING(CONVERT(varchar,SERVERPROPERTY(‘Edition’)),CHARINDEX(‘(‘,CONVERT(varchar,SERVERPROPERTY(‘Edition’))), 3), 2)like’64’ then’64’

else ’32’

end ‘SQL TYPE’,

case when substring(@@version,CHARINDEX(‘Hypervisor’,@@version),10)like’Hypervisor’ then ‘VM’

when substring(@@version,CHARINDEX(‘VM’,@@version),2)like’VM’ then ‘VM’
else ‘physical’ END ‘SERVER TYPE’

Version2

let me know if you are facing any issue with this script ..

enjoy 🙂

  1. July 1, 2013 at 6:34 pm

    Nice!

  2. July 2, 2013 at 2:57 pm

    Thanks a lot Thomas

  1. July 1, 2013 at 5:16 pm

Leave a comment