Groups | Blog | Home
all groups > c# > july 2004 >

c# : Enumerating Named Instances of SQL Server/MSDE


Michael C
7/17/2004 11:03:28 PM
Hi all,

I am currently using a Win32 API call to NetServerEnum to enumerate all SQL
Servers on an NT Domain. The function returns the names of all servers
running SQL Server on the network, but it doesn't return any SQL Server/MSDE
named instances. Does anyone have any ideas on how to enumerate all named
instances of SQL Server/MSDE on a Domain as well as the default instances?

Thanks,
Michael C.

Shiva
7/18/2004 4:41:56 PM
Hi,

Here is an another way to do it:
http://www.codeproject.com/cs/database/LocatingSql.asp

[quoted text, click to view]
Hi all,

I am currently using a Win32 API call to NetServerEnum to enumerate all SQL
Servers on an NT Domain. The function returns the names of all servers
running SQL Server on the network, but it doesn't return any SQL Server/MSDE
named instances. Does anyone have any ideas on how to enumerate all named
instances of SQL Server/MSDE on a Domain as well as the default instances?

Thanks,
Michael C.


Michael C
7/18/2004 5:34:49 PM
Hi Shiva,

I actually tried that method but it didn't work seem to work for MSDE named
instances for some reason... Oh well, back to the drawing board...

Thanks,
Michael C.

[quoted text, click to view]

FusionGuy
7/19/2004 12:46:57 PM
http://www.codeproject.com/csharp/CompPickerLib.asp

The best way is to use SQL-DMO.

[quoted text, click to view]

Michael C
7/20/2004 12:22:49 AM
Even tried that (though I'm a little wary of it since I can't guarantee that
every installation of my app will also have SQL Client Tools installed
also)... It doesn't pick up anything if you disconnect from the network -
even if there are local instances running. Also had some problems with MSDE
named instances with SQL-DMO too. I think SQL Enterprise Manager uses
SQL-DMO, and it doesn't detect named instances automatically either on
server registration.

Strange.

Thanks,
Michael C.

[quoted text, click to view]

Benny Tordrup
7/20/2004 10:39:13 AM
Michael, se my posting in the thread
Re: Get all sql servers on network from dot net app.. sqldmo or reflection

in microsoft.public.sqlserver.programming

"Michael C" <nospam@lol.net> skrev i en meddelelse
news:4fiKc.31909$Kz3.3077912@news4.srv.hcvlny.cv.net...
[quoted text, click to view]

Michael C
7/31/2004 11:41:39 PM
Thanks, but it like NetServerEnum and the other API functions it doesn't
seem to pick up Named Instances which is what I need.

Thanks
Michael C.

[quoted text, click to view]

AddThis Social Bookmark Button