Re: which statement fire the trigger ?
From: David Gugick (davidg-nospam_at_imceda.com)
Date: 01/12/05
- Next message: Geir Holme: "Re: Help with at simple rank query."
- Previous message: David Gugick: "Re: using SQLserver, ADO, Delphi: performance issue"
- In reply to: Vinod Kumar: "Re: which statement fire the trigger ?"
- Next in thread: Juraj Rojko: "Re: which statement fire the trigger ?"
- Reply: Juraj Rojko: "Re: which statement fire the trigger ?"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 12 Jan 2005 01:48:40 -0500
Vinod Kumar wrote:
> In 2000? Is this possible? What are the Events I need to include?
>
>
> "Andrew J. Kelly" <sqlmvpnooospam@shadhawk.com> wrote in message
> news:eIoDvtD%23EHA.1296@TK2MSFTNGP10.phx.gbl...
>> You can use profiler.
>>
>> --
>> Andrew J. Kelly SQL MVP
>>
>>
>> "TLV" <tlv@cassava.net> wrote in message
>> news:%23FFtfRD%23EHA.2112@TK2MSFTNGP10.phx.gbl...
>>> Hi ,
>>>
>>> Is there any way to get the sql statement that fire a trigger ?
>>>
>>> Thank you in advance ,
>>> TLV
Triggers do not have specific events in Profiler. The statements in the
trigger show up as SP:StmtStarting/Completed events, but without
SP:Starting/Completed events. You'll need to capture SQL:StmtStarting,
RPC:Starting, SP:StmtCompleted or Starting. Here's an example:
create table test_trig(col1 int)
create trigger testtrig_ins on test_trig
for insert
as
If (select count(*) from inserted) > 1
rollback tran
insert into test_trig values (5)
SQL:StmtStarting insert into test_trig values (5)
SP:StmtCompleted -- testtrig_ins create trigger testtrig_ins on
test_trig
SP:StmtCompleted -- testtrig_ins If (select count(*) from inserted) > 1
SP:StmtCompleted
SQL:StmtCompleted insert into test_trig values (5)
SQL:BatchCompleted insert into test_trig values (5)
-- David Gugick Imceda Software www.imceda.com
- Next message: Geir Holme: "Re: Help with at simple rank query."
- Previous message: David Gugick: "Re: using SQLserver, ADO, Delphi: performance issue"
- In reply to: Vinod Kumar: "Re: which statement fire the trigger ?"
- Next in thread: Juraj Rojko: "Re: which statement fire the trigger ?"
- Reply: Juraj Rojko: "Re: which statement fire the trigger ?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|