March 10, 2005 at 3:21 pm
Hi all,
I remember something on this site a year or so ago that instructed how to capture the results of a sproc or DBCC command into a table for analysis. Haven't used in a while, so naturally the knowledge evaporated. Any ideas?
Thanks in advance!
Carter
But boss, why must the urgent always take precedence over the important?
March 10, 2005 at 3:30 pm
Here's a little example to get you going...
create table #who2
(
#SPID int NULL,
#Status varchar(30) NULL,
#Login sysname NULL,
#HostName sysname NULL,
#BlkBy varchar(128) NULL,
#DBName sysname NULL,
#Command varchar(128) NULL,
#CPUTime int NULL,
#DiskIO int NULL,
#LastBatch char(14) NULL,
#ProgramName sysname NULL,
#SPIDb int NULL)
insert #who2
exec sp_who2
select * from #who2
drop table #who2
-- Steve
March 11, 2005 at 1:57 am
You may also be thinking of this? (also needs a premade table to load into like the above example)
Many DBCC commands can produce output in tabular form (using the WITH TABLERESULTS option). This information can be loaded into a table for further use.
eg.
USE pubs
INSERT <premadeTable>
DBCC SHOWCONTIG WITH TABLERESULTS, ALL_INDEXES
..and so on..
/Kenneth
March 11, 2005 at 7:49 am
Thanks for the help - that's exactly what I needed!
Have a great weekend.
Carter
But boss, why must the urgent always take precedence over the important?
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply