hi,
I want to get all the server's processes last command in a stored procedure.
What I know now is that I could get the last command of one specific process
by using DBCC Inputbuffer, but I could not insert the result into a table.
Any one has other ways to get the last command and could save in a table?
I am using SQL Server 2000.
Thanks in advance
FrankFrank
> but I could not insert the result into a table
create table #test
(
col1 varchar(500),
col2 int,
col3 varchar(1000)
)
insert into #test exec ('dbcc inputbuffer(99)')
select * from #test
"Frank" <wangping@.lucent.com> wrote in message
news:umRj%23fmwFHA.3756@.TK2MSFTNGP10.phx.gbl...
> hi,
> I want to get all the server's processes last command in a stored
> procedure.
> What I know now is that I could get the last command of one specific
> process
> by using DBCC Inputbuffer, but I could not insert the result into a table.
> Any one has other ways to get the last command and could save in a table?
> I am using SQL Server 2000.
> Thanks in advance
> Frank
>|||Hi Frank
Try (for SPID 52):
CREATE TABLE #inputbuffer (
EventType varchar(20),
parameter INT,
Eventinfo varchar(80)
)
-- Execute the command, putting the results in the table
INSERT INTO #inputbuffer
EXEC ('DBCC INPUTBUFFER (52) WITH NO_INFOMSGS')
-- Display the results
SELECT *
FROM #inputbuffer
GO
John
"Frank" wrote:
> hi,
> I want to get all the server's processes last command in a stored procedure.
> What I know now is that I could get the last command of one specific process
> by using DBCC Inputbuffer, but I could not insert the result into a table.
> Any one has other ways to get the last command and could save in a table?
> I am using SQL Server 2000.
> Thanks in advance
> Frank
>
>|||Thanks Dimant!
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:%23xVBJpmwFHA.460@.TK2MSFTNGP15.phx.gbl...
> Frank
> > but I could not insert the result into a table
> create table #test
> (
> col1 varchar(500),
> col2 int,
> col3 varchar(1000)
> )
> insert into #test exec ('dbcc inputbuffer(99)')
> select * from #test
>
> "Frank" <wangping@.lucent.com> wrote in message
> news:umRj%23fmwFHA.3756@.TK2MSFTNGP10.phx.gbl...
> > hi,
> > I want to get all the server's processes last command in a stored
> > procedure.
> > What I know now is that I could get the last command of one specific
> > process
> > by using DBCC Inputbuffer, but I could not insert the result into a
table.
> > Any one has other ways to get the last command and could save in a
table?
> > I am using SQL Server 2000.
> >
> > Thanks in advance
> > Frank
> >
> >
>|||John,
Thanks for your information
Frank
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:86A3B320-1959-48B7-90A0-6BCCC77793BA@.microsoft.com...
> Hi Frank
> Try (for SPID 52):
> CREATE TABLE #inputbuffer (
> EventType varchar(20),
> parameter INT,
> Eventinfo varchar(80)
> )
> -- Execute the command, putting the results in the table
> INSERT INTO #inputbuffer
> EXEC ('DBCC INPUTBUFFER (52) WITH NO_INFOMSGS')
> -- Display the results
> SELECT *
> FROM #inputbuffer
> GO
> John
> "Frank" wrote:
> > hi,
> > I want to get all the server's processes last command in a stored
procedure.
> > What I know now is that I could get the last command of one specific
process
> > by using DBCC Inputbuffer, but I could not insert the result into a
table.
> > Any one has other ways to get the last command and could save in a
table?
> > I am using SQL Server 2000.
> >
> > Thanks in advance
> > Frank
> >
> >
> >
No comments:
Post a Comment