RE: SQL-DMO

RE: SQL-DMO

 

  

Hi Usman,

here is a very rudimentary script which does what you want:


Dim oApp
Dim oNames
Dim srvlist



Set oApp = CreateObject("SQLDMO.Application")

Set oNames = oApp.ListAvailableSQLServers()



For Each oName In oNames

srvlist =srvlist & Chr(9) & oName

Next

Wscript.Echo(srvlist)

There is a lot about about DMO on Tecnet on Ms' website. Also look round the
various bulletin boards, newsgroups etc. There used to be sonme good stuff
on the UK SQL User group's site from Allan Mitchell - who I've just seen
has replied to yourpost - I'll leave uyou in his far more capable hands.

Charles

> -----Original Message-----
> From: Usman Farhat [SMTP:Usman.[Email Address Removed] Sent: Monday, February 24, 2003 11:04 AM
> To: LazyDBA.com Discussion
> Subject: SQL-DMO
>
> Hi everyone,
> Has any one worked on sql-Dmo . Situation is for example in some
> application, i wana get list of all sql servers that are available ,for
> users to select one out of them for connecting to particular server ,and
> application than shows list of all databases ,server contains . I have
> ruff idea that this can be accomplish using sql-dmo ,but did any one has
> better idea or stuff about it.
> Thanks a lot for your people concern ...
> Regards,
> Usman
>
> ---------------------------------------------------------------------
> TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
> To unsubscribe, e-mail: mssqldba-[Email Address Removed] For additional commands, e-mail: mssqldba-[Email Address Removed]MS Sql Server LazyDBA home page