Frias-JH
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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.