Multiple SQL instances

value “Version” of key (concatenation of (“HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server” ; (values of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL” of native registry as string) ; “\Setup”)) of native registry

The following relevance will return the SQL version found by looking for the instance name. This works great with one instance name, but fails when there are multiple instances of SQL. How do I tweak this so it returns all versions of SQL instances found. I have some servers with multiple versions of SQL installed. I would like it to return one answer for each version of SQL so the property will show multiple results in the console.

I’m not good at relevance and I been working on this all day and I’m stuck now. Any help would be appreciated. Thanks

See if this works for you.

values "Version" of keys "Setup" of keys (values of keys "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL" of native registry as string) of keys "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server" of native registry

If you wanted to know the instance name and its version, something like this

Q: (names of parent key of it, values "Version" of it) of keys "Setup" of keys (values of keys "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL" of native registry as string) of keys "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server" of native registry
A: MSSQL11.MSSQLSERVER, 11.4.7001.0
A: MY.DUMMY, 21.1.4.7.0
1 Like