All versions SQL Server Registry Key
Is there any registry value that i could check to see if there is any version of SQL Server installed? I want to check a single va开发者_如何转开发lue...not a value for 2005 another one for 2008 etc.
I've had the same problem. I don't think there's a 'one stop shopping' location for this.
What really complicates this is the concept of named instances - where you can have multiple versions of sql installed on the same machine.
For example:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\Inst1\MSSQLServer\CurrentVersion
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\Inst2\MSSQLServer\CurrentVersion
For SQL 2008, at least, you can enumerate the list of instances at
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL
What about
HKLM\Software\Microsoft\MSSQLServer\MSSQLServer\CurrentVersion
Just to confirm, the above registry key works (and is available) for both SQL Server 2008 and SQL Server 2008 R2
All the SQL Versions registry key will be under :
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
Based on different versios these are the registry keys for both 64 bit and 32 bit :
For SQL 2016 : HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft SQL Server 13
For SQL 2014 : HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft SQL Server 12
For SQL 2012 : HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft SQL Server 11
For SQL 2008 : HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft SQL Server 10
For SQL 2005: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft SQL Server 2005
精彩评论