I’m trying to pull the display name of SQL from the registry in an analysis. Here’s what I have so far. I get “This expression could not be parsed”. Can you show me what I’m doing wrong? Thanks.
if (exists value “DisplayName” of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft SQL Server 2005” of native registry) then (value “DisplayName” of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft SQL Server 2005” of registry as string) else if (exists value “DisplayName” of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft SQL Server 2000” of native registry) then (value “DisplayName” of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft SQL Server 2000” of registry as string) else “Not Installed”
if (exists value “DisplayName” of keys “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft SQL Server 2005” of native registry) then (value “DisplayName” of keys “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft SQL Server 2005” of registry as string) else if (exists value “DisplayName” of keys “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft SQL Server 2000” of native registry) then (value “DisplayName” of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft SQL Server 2000” of registry as string) else “Not Installed”
Yes. That works. Just the plural “keys” then. Thanks Ben. You guys are a real life saver. I’m hoping to get some training dollars in the coming year to take the advanced course for relevance. I need a better understanding of it from the ground up. I woke up thinking that it was likely that you guys have solved this problem before. Do you have a link to a post for general SQL product discovery?