Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change Application Name in Sql Server Profiler

When profiling a .Net Application in SQL Server Profiler the default Application Name is taken from the Data Provider. How can I change this to my own Application Name?

like image 660
Daniel Stackenland Avatar asked Nov 26 '14 10:11

Daniel Stackenland


People also ask

What is application name in connection string?

Simply include "Application Name=MyAppName;" in the connection string. After that it is also possible to use that value in SQL batches or SPROCs with the command, "SELECT APP_NAME();".

Is SQL Server profiler deprecated?

SQL Server Profiler is an interface to create and manage traces and analyze and replay trace results. Events are saved in a trace file that can later be analyzed or used to replay a specific series of steps when diagnosing a problem. SQL Trace and SQL Server Profiler are deprecated.


1 Answers

Just add Application Name=My Application; to the Connectionstring

Example: connectionString="Server=mySqlServer;Initial Catalog=myDatabase;User id=aUser;Password=aPassword;Application Name=My Application;"

You can also use App=My Application

like image 56
Daniel Stackenland Avatar answered Oct 10 '22 23:10

Daniel Stackenland