Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
SQL
ce
clients
clustering
connect
datamining
datawarehouse
dts
fulltext
jdbcdriver
msde
mseq
newusers
notificationsvcs
odbc
olap
programming
replication
reportingsvcs
security
securitytools
server
setup
sqlxml.viewmapper
tools
xml
  
 
date: Fri, 4 Jul 2008 15:17:44 +0530,    group: microsoft.public.sqlserver.connect        back       


Discover SQL servers   
Hi All,
   Using TCP method , is it possible to find all the SQL instances running 
on a machine?
Thanks in advance.
Supriya.
date: Fri, 4 Jul 2008 15:17:44 +0530   author:   Supriya

RE: Discover SQL servers   
Not sure what you meant by 'TCP method'. If you just scan the ports, it is 
not reliable and practical. I found it's most reliable to identify the SQL 
Server services by inspecting the registry.  That of course requires access 
to the registry..

Linchi

"Supriya" wrote:

> Hi All,
>    Using TCP method , is it possible to find all the SQL instances running 
> on a machine?
> Thanks in advance.
> Supriya. 
> 
> 
>
date: Sun, 6 Jul 2008 20:12:04 -0700   author:   Linchi Shea

Re: Discover SQL servers   
It's easy to discover what SQL Servers are on the net--even when they aren't 
running. The following is a segment of code from an example I use in my 
workshops and session talks (it's from my book). It should get you started.

Private Sub ReturnListOfServerInstances(ByVal sender As System.Object, ByVal 
e As System.EventArgs) Handles Button1.Click
        Dim drProvider As DataRow = 
DbProviderFactories.GetFactoryClasses.Rows(0) ' To make sure object is 
instantiated
        Try
            Me.Cursor = Cursors.WaitCursor
            ' DbProviderFactories is a new class for ADO 2.0
            ' GetFactoryClasses is a new method for ADO 2.0
            tblProviders = DbProviderFactories.GetFactoryClasses()
            For Each drProvider In tblProviders.Rows
                Dim factory As DbProviderFactory = 
DbProviderFactories.GetFactory(drProvider)
                Dim dsE As DbDataSourceEnumerator = 
factory.CreateDataSourceEnumerator()
                If dsE Is Nothing Then
                Else
                    DataGridView1.DataSource = dsE.GetDataSources()
                End If
            Next drProvider
        Catch exCE As System.Configuration.ConfigurationException
            MsgBox("The " & drProvider(0).ToString & " could not be 
loaded.")
        Catch ex As Exception
            MsgBox(ex.ToString)
        Finally
            Me.Cursor = Cursors.Default
        End Try
    End Sub

"Linchi Shea"  wrote in message 
news:9A049AA4-2C97-484D-AA70-45D8B7F53372@microsoft.com...
> Not sure what you meant by 'TCP method'. If you just scan the ports, it is
> not reliable and practical. I found it's most reliable to identify the SQL
> Server services by inspecting the registry.  That of course requires 
> access
> to the registry..
>
> Linchi
>
> "Supriya" wrote:
>
>> Hi All,
>>    Using TCP method , is it possible to find all the SQL instances 
>> running
>> on a machine?
>> Thanks in advance.
>> Supriya.
>>
>>
>>

-- 
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205  (Pacific time)
Hitchhiker’s Guide to Visual Studio and SQL Server (7th Edition)
____________________________________________________________________________________________
date: Tue, 8 Jul 2008 10:32:22 -0700   author:   William Vaughn \(MVP\)

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us