I started following the instructions at
https://www.mssqltips.com/sqlservertip/1715/scheduling-a-sql-server-profiler-trace/ and feel like this isn't going to work with what I would consider a reasonable investment of time. Like u said it looks limited to one object name and for
the few seconds it ran while I was capturing the definition, I got a lot of stuff that doesn't even have my object name in it. I'm going to look for a better article.
I'm suggesting you use cmdtext like %tablename%, and you can give multiple names to match, you have to use that on just statement or RPC completion, and I forget, but may have to also specify "only record on match".
Work on the filter values in the interactive Profiler GUI then have it write the script for you, with that as an example typically you can quickly see how to modify directly. If not, go back and work the GUI again until you get it!
Profiler is well worth spending some time to get familiar with - profiler and the trace script version of same.
(also - filter only statements with duration > 1000 ms for starters, see how much traffic that gets you, then adjust it up or down as appropriate. you almost never want to capture *everything* profiler can see, that can generate gigabytes of noise
per minute and that much capture will slow down the server, but with reasonable filters it's invisible)
You can probably do a lot of it with event handlers as well in SQL 2008, but I never have.
Josh
-
Edited by
JRStern
7 hours 56 minutes ago