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 data 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’
let me know if you are facing any issue with this script ..
enjoy 🙂
Nice!
Thanks a lot Thomas