Hello,
I am trying to find the list of all available sqlservers...with something
like this and making it a .vbs and running it from the command promt on my
windows 2000 and write to text file.
can anybody help me with that.
Dim oListSvr
Set oServer = CreateObject("SQLDmo.SqlServer")
oServer.Application.ListAvailableSQLServers
'always clean up when you’re done
'oServer.DisConnect
Set oServer = Nothing
Thanks In Advance..chinn wrote:
> I am trying to find the list of all available sqlservers...with something
> like this and making it a .vbs and running it from the command promt on my
> Windows 2000 and write to text file.
> can anybody help me with that.
> Dim oListSvr
> Set oServer = CreateObject("SQLDmo.SqlServer")
> oServer.Application.ListAvailableSQLServers
> 'always clean up when youre done
> 'oServer.DisConnect
> Set oServer = Nothing
Hi,
Try this and let us know if it works. The output can be redirected to a text
file:
Option Explicit
Dim objSQL, objServers, j
Set objSQL = CreateObject("SQLDMO.Application")
Set objServers = objSQL.ListAvailableSQLServers()
For j = 1 To objServers.Count
Wscript.Echo objServers.Item(j)
Next
Set objServers = Nothing
Set objSQL = Nothing
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab web site - http://www.rlmueller.net
--|||check the output of the "isql.exe -L" utility.
"chinn" wrote:
> Hello,
> I am trying to find the list of all available sqlservers...with something
> like this and making it a .vbs and running it from the command promt on my
> Windows 2000 and write to text file.
> can anybody help me with that.
> Dim oListSvr
> Set oServer = CreateObject("SQLDmo.SqlServer")
> oServer.Application.ListAvailableSQLServers
> 'always clean up when you’re done
> 'oServer.DisConnect
> Set oServer = Nothing
> Thanks In Advance..
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment