Set task priority in MS SQL | |
---|---|
Next stored procedure let's you set thread priority in MSSQL. You can use the function to set some task in idle or another priority.
--set idle priority for the task EXECUTE sp..xp_set_thread_priority -15, 0 --call some SP in idle priority EXECUTE sp_longrunning --set default priority EXECUTE sp..xp_set_thread_priorityBe sure you set default thread priority at the end of your SP/SQL batch (execute xp_set_thread_priority without parameters). --Let's you set thread priority in MSSQL CREATE PROCEDURE xp_set_thread_priority(@Priority INT = 0, @PriorityBoost INT = 1) AS DECLARE @Thread INT, @OLEResult INT, @Out INT --Create ScriptUtils.Thread object EXECUTE @OLEResult = sp_OACreate 'ScriptUtils.Thread', @Thread OUT IF @OLEResult <> 0 RAISERROR ('ScriptUtils.Thread cannot be created. Result : 0x%X', 1, 1, @OLEResult) ELSE BEGIN --Set priority boost of actual thread EXECUTE @OLEResult = sp_OASetProperty @Thread, 'PriorityBoost', @PriorityBoost IF @OLEResult <> 0 RAISERROR ('Cannot set PriorityBoost. Result: 0x%X', 1, 1, @OLEResult) --Set priority of actual thread EXECUTE @OLEResult = sp_OASetProperty @Thread, 'Priority', @Priority IF @OLEResult <> 0 RAISERROR ('Cannot set Priority. Result: 0x%X', 1, 1, @OLEResult) --Destroy Thread object EXECUTE @OLEResult = sp_OADestroy @Thread END RETURN @OLEResult |
Thread object. Timing informations, priority settings and Ids.
Huge ASP upload is easy to use, hi-performance ASP file upload component with progress bar indicator. This component lets you upload multiple files with size up to 4GB to a disk or a database along with another form fields. Huge ASP file upload is a most featured upload component on a market with competitive price and a great performance . The software has also a free version of asp upload with progress, called Pure asp upload , written in plain VBS, without components (so you do not need to install anything on server). This installation package contains also ScriptUtilities library. Script Utilities lets you create hi-performance log files , works with binary data , you can download multiple files with zip/arj compression, work with INI files and much more with the ASP utility.
© 1996 - 2011 Antonin Foller, Motobit Software | About, Contacts | e-mail: info@pstruh.cz