Connection strings and application name


There are many things that developers and DBA’s can do to help their relationships run smoothly, most of them are relatively simply things – as this tip is today.

DBA’s often have to track down problems – often performance related – and they tend to use profiler for the job.

When running profiler the name of the developer’s application will show up in he “Application Name” column.

This column is simply filled by taking the value of the “Application Name” attribute from the connection string.

Here’s an example of a connection string with the “Application Name” attribute in it.

Data Source=TheServer; Initial Catalog=TheDB; User Id=Username; Password=myPassword; Application Name=OurFancyApplication;

So now, what show’s up in the Application Name column of profiler is OurFancyApplication

Application Name is not a compulsory attribute in the connection string – so you can choose to leave it out, but if you do profiler will just display a generic value – .NET sqlClient Data Provider – in the Application Name column

Having the Application Name show the correct name of you app, is a big help to the DBA, especially when they are looking at a busy server, attempting to track down a troublesome connection.

So, if you’re a developer, please be kind to your DBA and include the Application Name attribute in you connection string.

In case anybody is looking for more information / examples about connection string, just look here.

Have a nice day



Related Posts :-  The developer / DBA relationship

About Martin Catherall

Martin Catherall is Senior SQL consultant at SQL Down Under, based in Melbourne, Australia. Martin is also a Microsoft Data Platform MVP and Regional Mentor (RM) for the Professional Association for SQL Server. Prior to relocating to Australia he was extremely active in the Christchurch, New Zealand data community - founding the local SQL Server user group and organizing SQL Saturday Christchurch - which later became SQL Saturday South Island. He likes learning interesting stuff about processing and storing data and passing on his knowledge. In his spare time he likes to learn guitar and hang out with his two young sons Callum Glen and Robert Michael.