How to save the data of running sp_helpdb master to two tables

  • how to

    If I want to store the data of running sp_helpdb to a table, I can use below way.

    create table all_database

    (

    dbname sysname,

    dbsize nvarchar(13) null,

    owner sysname null,

    dbid smallint,

    created nvarchar(11),

    dbdesc nvarchar(600) null,

    cmptlevel tinyint

    )

    insert into all_database exec sp_helpdb

    The sp_helpdb only gives out a table. But if we run sp_helpdb master, it will give out two tables with the information. Do anyone know how to save the data from the two given tables to the database?

  • I recommend querying sys.databases and sys.master_files

  • Suresh B. (8/1/2011)


    I recommend querying sys.databases and sys.master_files

    Yes, actually I can read from the definition of the SP to write the select statement. But what if I cannot know the definition and which table or view the data were got from?

    That I need is to store the data from two or more tables that a SP output to some tables.:hehe:

Viewing 4 posts - 1 through 3 (of 3 total)

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