Sometimes it may be useful to reuse the result of the DBCC commands. If the DBCC command resturns a resultset, it can be outputted to a table. Consider the following command
DBCC useroptions
It returns a single resultset. To copy the resultset to a table, you can use the following
Create table #dbcc_useroptions ([set option] varchar(100), [value] varchar(100)) insert into #dbcc_useroptions exec('DBCC useroptions') select * from #dbcc_useroptions drop table #dbcc_useroptions
Note that it is possible with dynamically executing DBCC commands and only the DBCC commands that return a resultset can be used
Tags: t-sql, sql_server, dbcc,