We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

SQL Status statement

Medium Priority
365 Views
Last Modified: 2012-05-11
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
Comment
Watch Question

Ephraim WangoyaSoftware Engineer
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.