3

I am creating an "After Update" Trigger on a SQL Server 2008 table. The trigger fires just fine but one of the values it's updating in another table isn't correct. I am looking at a trace in SQL Profiler, but I can't see my variable's values in there.

I read this other question and so added the RPC: Completed Event to my trace, but there were not instances of that event in my trace for some reason. That is, I see it at other places in the trace but not where my trigger is firing.

Just to (hopefully) be clear, my trigger is EXECUTING an SP like this:

EXEC SP_UpdateSomeStuff @variable1, @variable2

... and that's all that I see in the trace. What I wish to see is:

EXEC SP_UpdateSomeStuff @variable1 = 111, @variable2 = 222

... but I can't figure out which events to add to get this. Thanks for any ideas.

Community
  • 1
  • 1
Peter
  • 423
  • 5
  • 15

1 Answers1

1

"RPC" stands for "Remote Procedure Call" -- generally, queries submitted "from outside" to SQL Server. Trigger events are anything but outside calls, which should be why you are not seeing them in Profiler.

I suspect that you won't be able to see your paremeter values via SQL Profiler. Can you temporarily put in debugging code (insert DebugTable values (Wvariable1, etc.), such that the value you are working with get logged somewhere?

Philip Kelley
  • 39,426
  • 11
  • 57
  • 92