How to capture DBCC out put in a table

 

DROP TABLE #TempForLogSpace

go

CREATE TABLE #TempForLogSpace

(

 DBName varchar(32),

 LogSize real,

 LogSpaceUsed real,

 Status int

)

Declare @sql_command varchar(1000)

 

SELECT @sql_command = ‘dbcc sqlperf (logspace)’

 

INSERT INTO #TempForLogSpace EXEC (@sql_command)

 

select * from #TempForLogSpace

 

GO

______________________________________________________________________________________________

How to capture DBCC out put in a table

 

DROP TABLE #TempForLogSpace

go

CREATE TABLE #TempForLogSpace

(

 DBName varchar(32),

 LogSize real,

 LogSpaceUsed real,

 Status int

)

Declare @sql_command varchar(1000)

 

SELECT @sql_command = ‘dbcc sqlperf (logspace)’

 

INSERT INTO #TempForLogSpace EXEC (@sql_command)

 

select * from #TempForLogSpace

 

GO

 ___________________________________________________________________________________________________

DROP TABLE #inputbuffer

go

create table #inputbuffer(c1 varchar(15), c2 int, c3 varchar(255))

insert into #inputbufferEXEC(‘dbcc inputbuffer(7)’)

select * from #inputbuffer 

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s