retrieving data from system stored procedures

  • Dear all,

    I would like be able to pull up all those data that bring us system procedures such as sp_spaceused, sp_tables, into a temporary table and so on...

    Does anyone have ever used or experienced with the system procedure output?

    For example:

    sp_spaceused <TABLE>

    SP_TABLES

    Thank a lot for any input,

  • Maybe: (I haven't tried this......)

    SELECT INTO ##mytable

    FROM (EXEC sp_spaceused

    ) a

    -SQLBill

  • hi SqlBill,

    Unfortunately, that doesn't works. I am almost sure that might have any solution for that. Apparently BOL no says nothing about that.

    Think, think

  • I've created this:

    CREATE TABLE TESTSPACEUSED (

     FI varchar (60),

     ROWS1 INT,

     rESERVED varchar(20),

     data varchar(20),

     index_size varchar(20),

     unused varchar(30)

    ) ON [PRIMARY]

    GO

    And then I tried this statement, obtaining unsuccessful results:

    SELECT *

    FROM TESTSPACEUSED inner join  (sp_spaceused <table&gt as A on testspaceused.fi <> A.name

  • On the other hand, this works but not very perfectly...

    insert into testspaceused

     EXEC SP_MSFOREACHDB 'USE BDGENERAL; EXEC SP_SPACEUSED G03OFIC'

    testspaceused is the table above created...

  • On the other hand, this works but not very perfectly...

    insert into testspaceused

     EXEC SP_MSFOREACHDB 'USE BDGENERAL; EXEC SP_SPACEUSED G03OFIC'

    testspaceused is the table above created...

Viewing 6 posts - 1 through 5 (of 5 total)

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