Relevance to Find Servers with MS-SQL 2008 & MS-SQL 2014

I was trying to find servers with MS-SQL 2008, or MS-SQL 2014, and I tried the following relevance, but it doesn’t seem to be getting all the machine that I would expect (I checked BigFix Inventory, and I’m seeing quite a few more)

Here is what I’m using for MS-SQL 2008:
(exists keys whose (exists value "CurrentVersion" whose ((it = "10.00") of (it as string as version)) of key "MSSQLServer\CurrentVersion" of it) of (keys "HKLM\SOFTWARE\Microsoft\Microsoft SQL Server" of it) of (x32 registry))

and here is what I’m using for MS-SQL 2014:
(exists keys whose (exists value "CurrentVersion" whose ((it = "12.00") of (it as string as version)) of key "MSSQLServer\CurrentVersion" of it) of (keys "HKLM\SOFTWARE\Microsoft\Microsoft SQL Server" of it) of (x32 registry))

Would changing x32 registry to x32 registry;x64 registry catch more systems? Is there something else that needs to be checked for?

Thanks,
Bob_K

I had to deal with this stuff recently as well and like this one since it works on both 32 bit and 64 bit systems without dealing with the registry:

q: product version of file (substring between "%22" of image path of service "MSSQLSERVER") as string | "Unknown"
A: 10.50.6529.0
T: 0.244 ms
I: singular string

So you could use variants like these (which were ran on a box with v10):

q: (product version of file (substring between "%22" of image path of service "MSSQLSERVER") = "10") | False
A: True
T: 0.260 ms
I: singular boolean

q: (product version of file (substring between "%22" of image path of service "MSSQLSERVER") = "12") | False
A: False
T: 0.270 ms
I: singular boolean
1 Like