Вход на сайт

Просмотр новости

Найдите то, что Вас интересует

Set Your Application Names Before You Wish You Had.

Дата публикации: 08-09-2026 13:15:59

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 […]

Основное содержимое страницы с новостью.

T-SQL & Development

By Brent Ozar · September 8, 2026 · 10 comments

Development

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.

Default program namesIf 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 email

Three posts a week, plus a Monday roundup of the best database news from around the web.

Схожие новости

#Наименование новостиТональностьИнформативностьДата публикации
1Smartmontools: Kritische SSD-Temperatur ermitteln09.6802-10-2026
2Database Animations: Why Higher Maxdop Equals More TempDB Spills012.8912-08-2026
3RE: Display name or number as a Match Condition for Triggers?01021-09-2026
4Points Well Taken: The Privacy Side of Loyalty Programs and Promotions06.6902-03-2026
5sp_TexasHoldEm: Multi-Player Poker in T-SQL014.0420-08-2026
6Sicherheitspatch gegen Schadcode repariert SolarWinds Observability Self-Hosted024.8224-09-2026
7And Then There Was The Time RCSI Actually Made Query Results More Accurate.07.0510-06-2026
8Sicherheitspatch gegen Schadcode repariert SolarWinds Observability Self-Hosted024.8224-09-2026
9Раскрыты быстрые советы для ускорения Windows01029-09-2026
10“But NOLOCK won’t hurt me if I’m using an index!”013.9515-09-2026

Классификация: . Схожих патентов: 0. Схожих новостей: 10. Тональность: 0. Информативность: 11.54. Источник: www.brentozar.com.