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?
Asked
Active
Viewed 1.7k times
1 Answers
43
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

Daniel Stackenland
- 3,149
- 1
- 19
- 22
-
2@MichealChoudhary I just tried this with SQL Server 2016 Developer and had no issues. The application name appeared in SQL Profiler. – Dan Wilson Aug 14 '18 at 19:25
-
2Worked for me in SQL Server 2017 & Management studio 18 – Nilay Mehta Feb 02 '19 at 02:20
-
in a website asp.net webform fails The requested database does not have a valid ADO.NET provider name set in the connection string. – Razmi Martinez Feb 08 '21 at 15:48
-
1If I use `Application Name=`, then I get a message from the driver (Native Client 11, and ODBC 17) telling me `Invalid connection string attribute`. However, `APP=` seems to work in most cases? [docs](https://learn.microsoft.com/en-us/sql/relational-databases/native-client/applications/using-connection-string-keywords-with-sql-server-native-client?view=sql-server-ver15) – GilesDMiddleton Aug 04 '21 at 09:33
-
Valid content of the connection string is highly dependent on which Data Provider you use. Please have a look at, for example, https://www.connectionstrings.com/sql-server/ for examples that you can use. – HansLindgren Oct 27 '22 at 07:53