Link to home
Start Free TrialLog in
Avatar of Frias-JH
Frias-JHFlag for United States of America

asked on

SQL Status statement

I am using the following query to delete a really large colelction of logs. I would like to chnge teh simple pint statement to increase with each cycle.

I.E.

1,000 rows deleted....
2,000 rows deleted...

while exists(select count(1) from <table> where LogDate <=getdate()-1)
begin
  set rowcount 1000
  delete from <table> where LogDate <=getdate()-1
  print '1,000 rows deleted'
  waitfor delay '00:00:01'
end
SOLUTION
Avatar of Ephraim Wangoya
Ephraim Wangoya
Flag of United States of America 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
ASKER CERTIFIED SOLUTION
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