Link to home
Start Free TrialLog in
Avatar of motioneye
motioneyeFlag for Singapore

asked on

sql008 to monitor batch job performance

Hi,
Can someone tell me how do I monitor the performance of this sql jobs with script below? basically I would like to know how long it takes to complete the batch at 1000 ?  I maybe will increase it until we satisfy with the performance

DECLARE @i INT
WHILE 1 = 1 BEGIN
     BEGIN TRANSACTION
      DELETE TOP(1000)
      FROM DB_Table  where timestamp < getdate() -185

      SET @i = @@ROWCOUNT
      commit transaction
      IF @i = 0 BREAK
      --PRINT '# of Records deleted in batch ---- ' + CAST(@i AS VARCHAR(10))
END
GO
ASKER CERTIFIED SOLUTION
Avatar of Anuj
Anuj
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial