Showing posts with label inputbuffer. Show all posts
Showing posts with label inputbuffer. Show all posts

Wednesday, March 28, 2012

How to get the SQL statement that caused the trigger fire ?

Hi:
Is it possible to grab the full text of the sql statement that caused a
trigger on a table to fire ?
I try to put the DBCC INPUTBUFFER(@.@.SPID) into the 1st line of the
delete trigger, and in Quary analyzer i'm able to see the DBCC
INPUTBUFFER result, but i don't know how to retrieve this result in my
application code (using ADO and ADO.Net).
Please help.
Thanks
JCVoonHi,
why not look at the trigger definition onthe table...that will tell you
under what conditions the trigger will fire....
"jcvoon" wrote:

> Hi:
> Is it possible to grab the full text of the sql statement that caused a
> trigger on a table to fire ?
> I try to put the DBCC INPUTBUFFER(@.@.SPID) into the 1st line of the
> delete trigger, and in Quary analyzer i'm able to see the DBCC
> INPUTBUFFER result, but i don't know how to retrieve this result in my
> application code (using ADO and ADO.Net).
> Please help.
> Thanks
> JCVoon
>

How to get the SQL statement that caused the trigger fire ?

Hi:
Is it possible to grab the full text of the sql statement that caused a
trigger on a table to fire ?
I try to put the DBCC INPUTBUFFER(@.@.SPID) into the 1st line of the
delete trigger, and in Quary analyzer i'm able to see the DBCC
INPUTBUFFER result, but i don't know how to retrieve this result in my
application code (using ADO and ADO.Net).
Please help.
Thanks
JCVoonHi,
why not look at the trigger definition onthe table...that will tell you
under what conditions the trigger will fire....
"jcvoon" wrote:
> Hi:
> Is it possible to grab the full text of the sql statement that caused a
> trigger on a table to fire ?
> I try to put the DBCC INPUTBUFFER(@.@.SPID) into the 1st line of the
> delete trigger, and in Quary analyzer i'm able to see the DBCC
> INPUTBUFFER result, but i don't know how to retrieve this result in my
> application code (using ADO and ADO.Net).
> Please help.
> Thanks
> JCVoon
>

Friday, March 23, 2012

How to get the last command of a SPID if not using the DBCC inputbuffer?

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
> >
> >
> >

How to get the last command of a SPID if not using the DBCC inputbuffer?

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
>|||Thanks Dimant!
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:%23xVBJpmwFHA.460@.TK2MSFTNGP15.phx.gbl...
> Frank
> 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...
table.[vbcol=seagreen]
table?[vbcol=seagreen]
>

How to get the last command of a SPID if not using the DBCC inputbuffer?

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
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
>
|||Thanks Dimant!
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:%23xVBJpmwFHA.460@.TK2MSFTNGP15.phx.gbl...[vbcol=seagreen]
> Frank
> 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...
table.[vbcol=seagreen]
table?
>