0

I want to find out how data is getting inserted to a particular table.

I mean to say I want to find out the job or Stored Proc which is running on my SQL Server and pushing data regularly into one of my tables.

  • hey bud, what version and database engine are you using? Is it SQL Server 2008 +? – Ali Razeghi May 31 '16 at 23:37
  • You could always remove/rename/forbid the table and see what breaks, but thats a bit too extreme in most production cases. – jkavalik Jun 1 '16 at 6:07
1

Copied from a Stack Overflow answer by Damian Leszczyński - Vash, could not find a duplicate here:

You can't set filter to trace specific table directly.

What you can do is specify a filter for Text Data:

File -> Properties -> Event Selection -> Column Filters -> TextData -> Like -> [Table Name]


Your other option is to use Extended Events, but it has a much higher learning curve. Be careful using Profiler in production. The way it reads the data has a very high overhead and it could also cause the client you're using to time out.

You could use a 'server side trace' but that also has a higher learning overhead. Use Profiler in prod at your own risk, and make sure you don't run the client on an important server.

  • 1
    why you say server side trace has a higher learning overhead. ? It can be easily scripted from profiler trace definition. – Kin Shah Jun 1 '16 at 17:39
  • +1. I agree it can but the OP didn't seem like he was familiar with any of that. For us it's super easy but for someone who might rarely use this stuff it's easier for them to just open profiler (GUI) vs scripting. However if he wishes to do that it'll be great too. I don't discourage it but technically a GUI is a lot easier for people than reading/writing a scirpt – Ali Razeghi Jun 1 '16 at 21:33
  • Extended events is much more targeted then filtering on Text in profiler. A 2008 version here stackoverflow.com/questions/3094735/…. Using the UI in SSMS 2012 should be simpler though. – Martin Smith Jun 1 '16 at 23:06
  • Though the approach I use there of adding an insert trigger and then filtering on that would also work for Profiler and would show some details , but you couldn't get the call stack to see the calling code. – Martin Smith Jun 1 '16 at 23:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.