When you run monitoring queries like sp_BlitzWho and sp_WhoIsActive, you wanna see the program names that are running the queries. It’s super useful when you’ve got multiple apps running on the same servers, or when you’ve got apps scattered across end user computers. If you don’t set the program names, you’ll either end up with […]
When you run monitoring queries like sp_BlitzWho and sp_WhoIsActive, you wanna see the program names that are running the queries. It’s super useful when you’ve got multiple apps running on the same servers, or when you’ve got apps scattered across end user computers.
If you don’t set the program names, you’ll either end up with empty strings, or your dev tool’s default name, like Core .Net SqlClient Data Provider, which doesn’t tell you jack.
It’s up to the developers to set the program name in code or in their connection string. Just tack it on to the end of your connection string like this:
Transact-SQL
|
1 |
server=MyServer;database=MyDatabase;Integrated Security=SSPI;Application Name=My Incredible Application; |
And then in your monitoring tools, you’ll be able to group sessions together by application.
One question that comes up a lot afterwards is, “I’m looking at the plan cache and Query Store – what application and what user ran this query?” Unfortunately SQL Server can’t/won’t store that since a query might conceivably be run thousands of times per second, all from different servers/apps/users. If you need to track down who’s running a query, your best bet will be to set up an Extended Events trace, or if it’s a long-running query, do sampling of sp_BlitzWho or sp_WhoIsActive to table periodically.
Free, 3× a week
Get my new posts by emailThree posts a week, plus a Monday roundup of the best database news from around the web.
| # | Наименование новости | Тональность | Информативность | Дата публикации |
|---|---|---|---|---|
| 1 | Smartmontools: Kritische SSD-Temperatur ermitteln | 0 | 9.68 | 02-10-2026 |
| 2 | Database Animations: Why Higher Maxdop Equals More TempDB Spills | 0 | 12.89 | 12-08-2026 |
| 3 | RE: Display name or number as a Match Condition for Triggers? | 0 | 10 | 21-09-2026 |
| 4 | Points Well Taken: The Privacy Side of Loyalty Programs and Promotions | 0 | 6.69 | 02-03-2026 |
| 5 | sp_TexasHoldEm: Multi-Player Poker in T-SQL | 0 | 14.04 | 20-08-2026 |
| 6 | Sicherheitspatch gegen Schadcode repariert SolarWinds Observability Self-Hosted | 0 | 24.82 | 24-09-2026 |
| 7 | And Then There Was The Time RCSI Actually Made Query Results More Accurate. | 0 | 7.05 | 10-06-2026 |
| 8 | Sicherheitspatch gegen Schadcode repariert SolarWinds Observability Self-Hosted | 0 | 24.82 | 24-09-2026 |
| 9 | Раскрыты быстрые советы для ускорения Windows | 0 | 10 | 29-09-2026 |
| 10 | “But NOLOCK won’t hurt me if I’m using an index!” | 0 | 13.95 | 15-09-2026 |