Use Application Name parameter when connecting to SQL Server Print

  • 0

Use Application Name parameter when connecting to SQL Server

 

This optional parameter can be a life saver. The DBAs will love that you provide this info for the connection.

 

Why?

If several apps are using a shared SQL Server and there are problems caused by a certain connection the database administrators will be able to locate that connection (SPID). However determining what app is using that connection (causing the error) is not as obvious. If the developer had included the application name in the connection string then it will be very obvious what app is causing the troubles. This will save hours.

How?

Simply include "Application Name=MyAppName;" in the connection string.

Summary

Do include the optional Application Name parameter in your connection strings when connecting to SQL Server. This way the SQL Server will have info on what application is using the connection. This can be invaluable info when locating errors on the database server.


Was this answer helpful?

« Back