A quickie to see how busy Your SQL server is right now.(without uisng Taskmanager...)CpuBusyInPercent IoBusyInPercent StartMeasure EndMeasure---------------------------- ---------------------------- ------------------------------ -----------------------35.690235690235 5.723905723905 2005-08-18 17:25:56.070 2005-08-18 17:26:01.087
CREATE PROCEDURE spHowBusy @measureforseconds INT = 5ASSET NOCOUNT ONDECLARE @s VARCHAR(8)SELECT @s = CONVERT(VARCHAR(8), DATEADD(SECOND,@measureforseconds,0), 8)DECLARE @busy INT, @idle INT, @io INT, @start DATETIMESELECT @busy = @@CPU_BUSY, @idle = @@IDLE, @io = @@IO_BUSY, @start = GETDATE()WAITFOR DELAY @sSELECT CpuBusyInPercent = 100.0 * (@@CPU_BUSY-@busy) / ((@@CPU_BUSY+@@IDLE)-(@busy+@idle)) ,IoBusyInPercent = 100.0 * (@@IO_BUSY-@io) / ((@@CPU_BUSY+@@IDLE)-(@busy+@idle)) ,@start AS StartMeasure ,GETDATE() AS EndMeasureGO
rockmoose