Wednesday, March 21, 2012

Identying all installed SQL Server instances on a machine

Hi,
I want to programmatically identify all SQL Server (2000 or 2005) instances
installed on a machine with Windows 2000 or 2003. One way is to browse
through the Windows registry and look for specific keys such as
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Mi
crosoft SQL Server. But the registry
is organized differently for SQL 2005 than SQL 2000 and maybe it will change
again for the next SQL version. And things get messy when both SQL 2000 & SQ
L
2005 instances co-exist on the same host. So is there an API I can use to
find the instances and not rely on Windows registry?
Thanks in advances for any pointers.
- VolcanoSQL-DMO for SQL 2000 and SMO for SQL 2005.
ML

No comments:

Post a Comment