How to list SQL 2005 Express instances

627 Views Asked by At

I would like to list what instances of SQL 2005 Server (Express Editon) are installed on local or remote machine (my app is in Native C++). I found that i can make it by SQLDMO, however it seems that SQLDMO does not see SQL 2005 Express Edition and call to ListAvailableSqlServers returns empty list.

How can i make it? Playing with system registry is an extreme solution and applies only for local machines.

2

There are 2 best solutions below

1
On

You can try SqlDataSourceEnumerator.GetDataSources(). Works well in C# and VB.Net though I haven't tried it from C++.

0
On

Got it... Found SQLBrowseConnect. Answer is as usual in MSDN :-)