WHILE EXISTS ( SELECT * FROM table WHERE <condition to delete>)
BEGIN
SET ROWCOUNT 1000
DELETE Table WHERE <Condition>
SET ROWCOUNT 0
ENd
WHILE EXISTS ( SELECT * FROM table WHERE <condition to delete>)
BEGIN
SET ROWCOUNT 1000
DELETE Table WHERE <Condition>
SET ROWCOUNT 0
ENd
Tags: delete large records, SQL server
This entry was posted on March 17, 2011, 12:01 pm and is filed under SQL server. You can follow any responses to this entry through RSS 2.0. You can leave a response, or trackback from your own site.
Arclite theme by digitalnature | powered by WordPress
follow: