May 9, 2006 at 7:27 am
hi all,
I found that osql /L would give the list of mssql server instances in the network, but i need a windows API or ODBC method to get it to implement in an application rather than a command mode utility.
May 9, 2006 at 7:40 am
What is your question?
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
May 9, 2006 at 8:22 am
If i need to find all mssql server instances installed in a network,
I could get this by typing osql /L.
But i would like to list the names of different mssql server instances
programatically to implement in an application using WinAPI
May 9, 2006 at 9:25 am
Not sure. Could you do something like
osql /L > sqlservers.txt
to redirect the output to a file called sqlservers.txt and then use that in your app?
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
May 9, 2006 at 9:39 am
Fine, Thanx
But then I would appreciate if i could get direct ways
-deena
May 10, 2006 at 2:46 am
There is an article on “The Code Project” that may be of use.
Enumerate SQL Server using SQL DMO
By Rashid Thadha
Get a list of SQL Servers to which you can connect.
May 10, 2006 at 5:35 am
Hi,
I've got some Delphi code that'll get a list of SQL Servers on your network if you want it.
May 10, 2006 at 9:19 am
Thanks for everyone those who have replied
I trying to work thro' SQLBrowseConnect of ODBC.
regards
deena
May 10, 2006 at 9:42 am
Don't think that this list will be authoritative in all cases on all networks. There are lots of reasons why all of the SQL Servers on a network potentially will not show up with "OSQL -L". Here's a few for starters:
RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."
May 10, 2006 at 12:27 pm
Have you tried SQL-DMO? What is your development environment?
May 10, 2006 at 1:15 pm
Whether you use a Windows API, ODBC or SQL DMO the information in my previous post still stands.
RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."
May 11, 2006 at 5:22 am
hi
I am using ODBC to connect the db with VC++
I have not tried SQL DMO. Do I able to list the servers without connecting to the server in local machine.
thanx
deena
May 11, 2006 at 7:37 am
Here is sample VB code to display all available SQL servers:
Dim i As Integer
For i = 1 To SQLDMO.ListAvailableSQLServers.Count
MsgBox SQLDMO.ListAvailableSQLServers(i)
Next i
Viewing 13 posts - 1 through 12 (of 12 total)
You must be logged in to reply to this topic. Login to reply