LISTING 2: Capturing DBCC Result Set Output in a Tracking Table
Step 1: /* Create a wrapper sp to run the DBCC PERFLOG command. */
Step 2: /* Create a table we can use for tracking log utilization
            information. */
Step 3: /* Populate our tracking table. */
Step 4: /* Look at the output. */

/* Create a wrapper sp to run the DBCC PERFLOG command. */
create proc RunPerfLog 
as 
  dbcc perflog
go

/* Create a table we can use for tracking log utilization
    information. */
create table PerfLogOutput
(
PerfLogTime datetime default CURRENT_TIMESTAMP, 
DBName varchar(30), 
LogSize float, 
SpaceUsed float, 
Status bit
)
go

/* Populate our tracking table. */
insert into PerfLogOutput (DBName, LogSize,SpaceUsed, Status) 
exec RunPerfLog 
go

/* Look at the output. */
select * from PerfLogOutput