May 15, 2003 #1 nkm Programmer Joined May 27, 2001 Messages 45 Location US Can we delete rows in batches from a table until all rows with the particular condition are deleted. e.g. Delete first 10 from <tab1> where ... thanks
Can we delete rows in batches from a table until all rows with the particular condition are deleted. e.g. Delete first 10 from <tab1> where ... thanks
May 15, 2003 #2 qyllr MIS Joined Mar 8, 2001 Messages 131 Location US hello, try using set rowcount... set rowcount 10 while exists (select 1 from tableName where ...) begin delete tableName where ... end go hope this helps, q. Upvote 0 Downvote
hello, try using set rowcount... set rowcount 10 while exists (select 1 from tableName where ...) begin delete tableName where ... end go hope this helps, q.