Database Info from SQL-DMO

  • I want to use SQL-DMO to

    1. find all sql servers on our LAN

    2. Loop through those servers, to find all

    databases on those servers,

    3. Loop through those databases, to find their sizes, and

    4. Loop through each database to find the name and size of each table in the database and, finally,

    5. To record my findings in a text file or database!

    I'd like to do all this from a .vbs script file. Is this doable? If so, any hints on the "right" SQL-DMO objects and properties/methods to use would be appreciated.

    TIA,

    Bill Salkin

  • A good place to start would be here

    Explore

    The Explore sample guides a user through the SQL-DMO object tree, displaying the contents of collections and the properties of objects. The sample illustrates using the Properties collection and handling SQLServer2 object events.

    Default Location

    C:\Program Files\Microsoft SQL Server\80\Tools\Devtools\Samples\sqldmo\vb\explore

    Running the Sample

    Open the Explore.vbp project.

    Run the application.

    Once you understand the object model you can code the same functionality in vbScript

    There are several very good articles on this site dealing with DMO (Check out Andy Warren's section under columnists)

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply