Wednesday, March 21, 2012
Listing Available SQL Servers
For instance: when I create a data link using OLE DB there
is a ComboBox that lists all of the available SQL Servers
to connect to. How does this list get generated and
refreshed? I ask this because I see a particular server in
the list on my PC but I have a coworker whose list does
not contain the server.Doug,
'Enumerate SQL Servers using OLE-DB'
http://sqldev.net/misc/OleDbEnum.htm
'Enumerate SQL Servers in a domain using the LAN Manager API
NetServerEnum().'
http://sqldev.net/misc/EnumSQLSvr.htm
'Enumerate SQL Server instances on the network using the ODBC
SQLBrowseConnect functionality'
http://sqldev.net/misc/ListSQLSvr.htm
Dinesh
SQL Server MVP
--
--
SQL Server FAQ at
http://www.tkdinesh.com
"Doug" <carrd@.firstenergycorp.com> wrote in message
news:982501c433ad$4c706690$a101280a@.phx.gbl...
> How does a machine know what SQL servers are available.
> For instance: when I create a data link using OLE DB there
> is a ComboBox that lists all of the available SQL Servers
> to connect to. How does this list get generated and
> refreshed? I ask this because I see a particular server in
> the list on my PC but I have a coworker whose list does
> not contain the server.
Listing Available SQL Servers
For instance: when I create a data link using OLE DB there
is a ComboBox that lists all of the available SQL Servers
to connect to. How does this list get generated and
refreshed? I ask this because I see a particular server in
the list on my PC but I have a coworker whose list does
not contain the server.
Doug,
'Enumerate SQL Servers using OLE-DB'
http://sqldev.net/misc/OleDbEnum.htm
'Enumerate SQL Servers in a domain using the LAN Manager API
NetServerEnum().'
http://sqldev.net/misc/EnumSQLSvr.htm
'Enumerate SQL Server instances on the network using the ODBC
SQLBrowseConnect functionality'
http://sqldev.net/misc/ListSQLSvr.htm
Dinesh
SQL Server MVP
--
SQL Server FAQ at
http://www.tkdinesh.com
"Doug" <carrd@.firstenergycorp.com> wrote in message
news:982501c433ad$4c706690$a101280a@.phx.gbl...
> How does a machine know what SQL servers are available.
> For instance: when I create a data link using OLE DB there
> is a ComboBox that lists all of the available SQL Servers
> to connect to. How does this list get generated and
> refreshed? I ask this because I see a particular server in
> the list on my PC but I have a coworker whose list does
> not contain the server.
sql
Monday, March 19, 2012
ListAvailableSQLServers Problem
servers but it doesnt list the local machine in which SQL Server too is
running. Am i missin something?What is the local machine?
If it's xp with sp2 then see
http://support.microsoft.com/default.aspx?kbid=841249
Nigel Rivett
www.nigelrivett.net
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!|||What is the local machine?
If it's xp with sp2 then see
http://support.microsoft.com/default.aspx?kbid=841249
Nigel Rivett
www.nigelrivett.net
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!|||What is the local machine?
If it's xp with sp2 then see
http://support.microsoft.com/default.aspx?kbid=841249
Nigel Rivett
www.nigelrivett.net
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!|||What is the local machine?
If it's xp with sp2 then see
http://support.microsoft.com/default.aspx?kbid=841249
Nigel Rivett
www.nigelrivett.net
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!|||What is the local machine?
If it's xp with sp2 then see
http://support.microsoft.com/default.aspx?kbid=841249
Nigel Rivett
www.nigelrivett.net
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!|||What is the local machine?
If it's xp with sp2 then see
http://support.microsoft.com/default.aspx?kbid=841249
Nigel Rivett
www.nigelrivett.net
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!|||What is the local machine?
If it's xp with sp2 then see
http://support.microsoft.com/default.aspx?kbid=841249
Nigel Rivett
www.nigelrivett.net
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!|||What is the local machine?
If it's xp with sp2 then see
http://support.microsoft.com/default.aspx?kbid=841249
Nigel Rivett
www.nigelrivett.net
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!|||What is the local machine?
If it's xp with sp2 then see
http://support.microsoft.com/default.aspx?kbid=841249
Nigel Rivett
www.nigelrivett.net
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!|||no its not XP.. its 2000.
I have installed SQL server in 3 machines in network includin the one
where i am running the application. now with listavailableservers it
shows the other 2 machines but not the one on where i am working on.|||Is your local database available over the network? Have you enabled a
network protocal using svrnetcn.exe? I noticed the other day that the
documentation says that ListAvailableSQLServers lists 'network-visible
instances' of SQL Server...
I have been suffering a similar (but different) problem. On XP it
appears to decide that if you are not connected to a network then the
server is not 'network-visible' and therefore the (local) server is not
listed. Hmm...
Any suggestions on how to detect if SQLServer is running on the local
machine when it's not connected to a network?
Neil
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
ListAvailableSQLServers does not show local instances
I am using SQL DMO method ListAvailableSQLServers to get the list of all the SQL server available to the local machine.
For some reason, I get all the servers except the instances installed in the local machine. - The are all started.
Any help?
thanks.
I have seen some issues with latency (some servers may not respond fast enough). Also the server instance may be marked hidden.
Start SQL Computer Manager, right click on the Protocols node of the instance and select Properties. Then see if HideInstance is set to No (if not switch to "No" and restart server).
Also try SQLCMD -L
If you see your local instance then it may be a bug in DMO.
|||Thanks Michiel.I forgot to say that I am working with SQL 2000. I can't find the SQL Computer Manager. Also i try isql -L and I get only the default instance in my machine and nothing else, i.e., not the other instance and not any of the network SQL servers.
In the SQL Server Service Manager I can see all the available servers.
any help ?|||you can use the registry for search local instances
Example:
//Registry for local
RegistryKey rk = Registry.LocalMachine.OpenSubKey(@."SOFTWARE\Microsoft\Microsoft SQL Server");
String[] instances = (String[])rk.GetValue("InstalledInstances");
if (instances.Length > 0)
{
foreach (String element in instances)
{
String name = "";
//only add if it doesn't exist
if (element == "MSSQLSERVER")
name = System.Environment.MachineName;
else
name = System.Environment.MachineName + @."\" + element;
if (cmbServers.FindStringExact(name) == -1)
cmbServers.Items.Add(name);
}
the complete Code (smo) can you find at http://www.sqldbatips.com/showarticle.asp?ID=45
it works with dmo too
Friday, March 9, 2012
List of SQL Server 7.0/2000 instances running
I need to prepare the list of all sql instances.. pls help if possible to find details using sql query.I'd start with:EXECUTE master.dbo.xp_cmdshell 'osql -L'You might have to refine it a bit, but it is a place to start.
-PatP
Friday, February 24, 2012
List both SQL2000&2005 instance using SQLDMO
How can I list both SQL2000 and 2005 server instance using SQLDMO?
Thanks
Have you installed the SQL 2005 workstation components? There is an updated version of SQLDMO which supports SQL Server 2005. The DMO dll's that came with SQL Server 2000 won't be able to read SQL 2005 server information, but the 2005 DMO dll's should solve your problem.