SQL Profiler and "Application Name=MyApp;"

Here's a great trick that can be really handy if you're a fan of the SQL Profiler. In your application connection strings add the "Application Name" keyword/value.

 

Example.

server=MyServer;database=MyDatabase;Integrated Security=SSPI;Application Name=My Application;


After this is done, fire up SQL Profiler and you'll notice that the profiled events are categorized under the name you provide rather than the default Data Provider name.

 

I'm a big fan of the SQL Profiler when looking for performance gains, and it certainly makes it easier when each application hitting your SQL Server is identified this way. Take it a step further and setup your Trace (using the Trace Properties) to save the profiled data to a table for easy

analysis at a later date.  

 

Happy profiling.

   

Aaron Bjork