A. Some DBCC commands support this directly via the "insert into exec" type format, others don't. Examples of both are given.
A dbcc command that works "normally" is useroptions - this is an example from the books-online :-
drop table #tb_setopts
CREATE TABLE #tb_setopts (SetOptName varchar(35) NOT NULL ,SetOptValue varchar(35) null)
INSERT INTO #tb_setopts (SetOptName,SetOptValue) EXEC('dbcc useroptions')
select * from #tb_setopts
Another is dbcc sqlperf :-
DROP TABLE #TempForLogSpace
CREATE TABLE #TempForLogSpace
SELECT @sql_command = 'dbcc sqlperf (logspace)'
INSERT INTO #TempForLogSpace EXEC (@sql_command)
Another is dbcc inputbuffer :-
DROP TABLE #dbc
create table #dbc(c1 varchar(15), c2 int, c3 varchar(255))
insert #dbc EXEC('dbcc inputbuffer(7)')
One that doesn't is dbcc checkdb. To make this work you'll need to use xp_cmdshell and ISQL as follows :-
-- Note that all quotes are single quotes except the ones on the -Q option, which are double quotes
DROP TABLE #maint
DECLARE @SQLSTR varchar(255)
SELECT @SQLSTR = 'ISQL -E -Q"dbcc checkdb(master)"'
CREATE TABLE #maint (Results varchar(255) NOT NULL)
INSERT INTO #maint(Results) EXEC('master..xp_cmdshell ''ISQL -E -Q"dbcc checkdb(master)"''')
select * from #maint