Logging Stored Procedure from Trigger

Please support our MS SQL advertiser: Intel Parallel Studio Home
Reply

Join Date: Nov 2008
Posts: 1
Reputation: Cerin is an unknown quantity at this point 
Solved Threads: 0
Cerin Cerin is offline Offline
Newbie Poster

Logging Stored Procedure from Trigger

 
0
  #1
Nov 5th, 2008
I have an awkward problem. I'm debugging what I believe is a race condition in a legacy codebase. The issue involves a userID column being set to the wrong value. Essentially, one user's record will be non-deterministically reassigned to another user. The real problem is that this column is set from several different stored procedures, and there's no logging, so I don't even know where to start.

I was thinking of creating an update trigger on the column, and log the "to" and "from" values, but this doesn't really help me if I don't know what procedure's doing the update. Is there anyway to log the procedure doing the update from inside the trigger?
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,160
Reputation: dickersonka will become famous soon enough dickersonka will become famous soon enough 
Solved Threads: 137
dickersonka dickersonka is offline Offline
Veteran Poster

Re: Logging Stored Procedure from Trigger

 
0
  #2
Nov 5th, 2008
you could use SQL Profiler and it will show you all queries being executed, it will save you a lot of work from creating new tables and triggers and show you all sql statements being ran
Custom Application & Software Development
www.houseshark.net
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC