DBCC Commands

  • Hi

    I am using [DBCC IND] to return information related to my database pages. Is it possible to use this data in other statements?

    E.g.

    My current statement is:

    DBCC IND (DatabaseName, TableName, 3);

    There is no 'SELECT' syntax there, so how could I filter the returned columns etc? Also, how can I use the results? For example, if I wanted to insert the results into a temp table?

    Thanks for any information.

  • ggjjbb1983

    From Books On Line - with some DBCC commands you can:

    CREATE TABLE #tracestatus (

    TraceFlag int,

    Status int,

    Global int,

    Session int

    )

    -- Execute the command, putting the results in the table.

    INSERT INTO #tracestatus

    EXEC ('DBCC TRACESTATUS (-1) WITH NO_INFOMSGS')

    -- Display the results.

    SELECT *

    FROM #tracestatus

    GO

    DROP TABLE #tracestatus

    Running the command twice produced the following results:

    TraceFlagStatusGlobalSession

    8017 1 1 0

    8017 1 1 0

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • Thats what I needed. Thanks.

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

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