Ages ago I discovered a nice little feature in SQL Profiler to enable you to only see the queries which comes from your machine. Very useful if you are not the only one using a database and want to track down which queries you are responsible for initiating from your local machine. I assume that you have basic knowlegde of SQL Profiler and trace templates - otherwise you should read more about this fantastic profiling tool before you proceed.
- Start up SQL Profiler
- Choose File --> New trace and attach to your database
- Click on Show All Columns - and whoops: Up comes the column "Hostname". Choose this column for every event you want to appear in your trace.
- Click On "Column Filters"
- Find the "Hostname" column and enter your computer's hostname in the "like" field
- Save your trace as a trace template - name it i.e. "MyComputer"
I find it extremely powerfull because it enables you to debug single lines of code in Visual Studio and monitor exactly what SQL is hidden behind various peeks and pokes to your domain model. I use it about every time I use SQL Profiler - I couldn't live without my personal trace template.
Nothing magic about it - just one of these mighty fine things to have in your debugging toolbox I guess ;o)