0

I have a table Product which have Quantity column, This table get updated thru .net application using Stored procedure based on flag variable. Now im having problem reported from user that even though the flag variable is not set table is getting updated with new values.

Now i need to isolated the cause for the issue.How will i check which update and through which application this table is getting modified. I have no idea about it.

What is the best approach to resolve this issue?

sameer
  • 1,635
  • 3
  • 23
  • 35

1 Answers1

1

Assuming you are using SQL Server:

You can monitor calls to SQL Server using SQL Server Profiler. You can setup a filter to monitor queries affecting the Product table. The log will show what the query looked like, when the query was executed, the database user executing the query, the name of the application (if that is specified in the connection string) and a bunch of other things.

dillenmeister
  • 1,627
  • 1
  • 10
  • 18
  • I don't know when this issue happen, but it occurs we cannot set the log on for such a long time untill it occurs.Do we have any other way. We want to isolate the source of the query. – sameer Feb 14 '12 at 13:07
  • It is possible to have a trace running on the server without using the Profiler. Here is some info on doing that: http://stackoverflow.com/questions/564608/is-it-possible-to-automate-sql-server-2008-profiler – dillenmeister Feb 14 '12 at 13:52
  • And if you can't wait until it happens again, then I guess your only option is searching your source code for places where the Product table is being used. – dillenmeister Feb 14 '12 at 13:54