Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
samwids
Starting Member
4 Posts |
Posted - 2008-07-18 : 06:48:58
|
| All,I want to get the text of query that is just inserted/updated/delete (DML Statements). Query text that causes the trigger to fire.For e.g. I have an after insert trigger trig1 on table table1If insert query executed for table1 say "insert into table1 values ('AnyValue')" that will cause trig1 to fire. Inside that trigger I want to get the query text/insert statement that caused the trigger to fire.How can I? |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-07-18 : 06:52:27
|
| didnt understand the purpose of such a requirement. Can you explain why you want it? just been curious.. |
 |
|
|
samwids
Starting Member
4 Posts |
Posted - 2008-07-18 : 07:36:17
|
for auditing purpose, although there would be many approaches, but I want to go with it, is that possible?quote: Originally posted by visakh16 didnt understand the purpose of such a requirement. Can you explain why you want it? just been curious..
|
 |
|
|
samwids
Starting Member
4 Posts |
Posted - 2008-07-21 : 01:50:40
|
| Any SQL Guru? |
 |
|
|
rmiao
Master Smack Fu Yak Hacker
7266 Posts |
Posted - 2008-07-21 : 23:06:36
|
| Trace with profiler, or use third party's sql auditing tool. |
 |
|
|
samwids
Starting Member
4 Posts |
Posted - 2008-07-25 : 07:20:55
|
forbid but as far as I know, no one can run profiler withing trigger...........simply the requirement is that "Inside that trigger I want to get the query text/insert statement that caused the trigger to fire."quote: Originally posted by rmiao Trace with profiler, or use third party's sql auditing tool.
|
 |
|
|
|
|
|