October 1, 2010 at 5:38 pm
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.
October 1, 2010 at 8:26 pm
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
October 4, 2010 at 10:42 am
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
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy