xp_setpriority
In closing out this chapter, I'll leave you with an extended procedure that I think could change the way you work, especially if you manage a SQL Server installation in which long-running batch jobs and shorter, time-critical jobs regularly compete for system resources. Earlier, I mentioned that extended procedures run in the SQL Server process space. They also run in the context of the calling thread. That is, unless fiber mode has been enabled on the server, each connection gets its own Win32 thread. This thread is taken from the pool of worker threads that SQL Server creates on start-up and can change from query to query on the same connection. When an extended procedure runs, it runs within the context of this thread. This ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access