Home Forums SQL Server 2005 T-SQL (SS2K5) How to get the actual query text being fired for a particular operation. I'm trying to implement a trigger on a table where i need to store the query also. RE: How to get the actual query text being fired for a particular operation. I'm trying to implement a trigger on a table where i need to store the query also.

  • Is there a reason to do this in a trigger, as opposed to working from a trace? A trace will give you exactly what you're looking for, the proc name and parameter values. What are you doing with the data in the trigger?

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon