Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 Registry to check installed SQL Server instances?

Author  Topic 

pb
Starting Member

13 Posts

Posted - 2009-07-13 : 12:46:49
I need to implement a function to check existing SQL Server instances (including default ones) on a Windows system.

Currently I am using HKLM\Microsoft\Microsoft SQL Sever:InstalledInstances, will this work for SQL 7.0, MSDE (2000), SQL 2005 (including Express), and SQL 2008 (including Express)?

I don't have sources to install all of the flavors above, so I hope someone here has enough knowledge to tell me if that registry entry is good for all of them. If not (esp. SQL7 and SQL2008, which I don't have access to the installer), please provide the registry entry that I can use to check the installed instance(s), if there are any.


Thanks,
PB

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-07-13 : 21:18:24
maybe this will help http://weblogs.sqlteam.com/tarad/archive/2006/06/07/10114.aspx


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2009-07-13 : 22:24:47
You can simply use SERVERPROPERTY. No Need to read registry .
Go to Top of Page

pb
Starting Member

13 Posts

Posted - 2009-07-14 : 12:24:18
Thank you khtan and sodeep for your replies and ideas.

I don't know what dev enviornment sodeep meant to use "SERVERPROPERTY", unfortunately I am using InstallScript for my development, and I don't think there is such a variable.

What I want is to get ALL the installed SQL server instances on a system, so when user run my installation he/she will be prompted with a list of available (existing) SQL instances and have option to select one or create a new one. Since we can't predict what flavor/version of SQL our clients could have, we have to cover at least SQL 7.0/2000 (MSDE)/2005Exp./2005/2008, and due to the lack of the sources (installers/knowledge/systems) we would like to get some help from SQL experts here (we are not SQL developers).

The reason behind the idea is that we hope (and think should) that Microsoft has a (or couple) registry entry that persistent to all the flavors/versions of SQL to record the installed intances. Somebody in another forum said the registry entry I used also worked for SQL7 and MSDE, but after reading khtan's link, I felt less confident on the registry entry now, since it mentioned HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names registry key on SQL2000 (MSDE?) install, but on my systems, I only saw it on SQL2005Exp. install, but not MSDE install, while I did see
HKLM\Software\Microsoft\Microsoft SQL Sever:InstalledInstances on both installs.

Can anybody who has SQL7 and 2008 check to see if you can see the registry entry (HKLM\Software\Microsoft\Microsoft SQL Sever:InstalledInstances)? Or is the registry entry created depending on installation parameters?

Any help is greatly appreciated.

Thanks,
PB
Go to Top of Page
   

- Advertisement -