views:

178

answers:

2

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 value...not a value for 2005 another one for 2008 etc.

A: 

What about

HKLM\Software\Microsoft\MSSQLServer\MSSQLServer\CurrentVersion
Rubens Farias
+1  A: 

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

JohnW
I was afraid of this...thank you all for answering!