{"id":5297,"date":"2016-01-04T21:40:56","date_gmt":"2016-01-05T02:40:56","guid":{"rendered":"http:\/\/appcrawler.com\/wordpress\/?p=5297"},"modified":"2016-01-04T21:40:56","modified_gmt":"2016-01-05T02:40:56","slug":"deleting-in-a-loop-in-sql-server","status":"publish","type":"post","link":"http:\/\/appcrawler.com\/wordpress\/2016\/01\/04\/deleting-in-a-loop-in-sql-server\/","title":{"rendered":"Deleting in a loop in SQL Server"},"content":{"rendered":"<p>While discussing a way to delete many rows, but without deleting all of them at the same time (too much transaction logging), we came up with the following&#8230;<\/p>\n<p><img alt='' class='alignnone size-full wp-image-5299 ' src='http:\/\/appcrawler.com\/wordpress\/wp-content\/uploads\/2016\/01\/img_568b2c8d5049a.png' \/><\/p>\n<p>This works pretty well.  It&#8217;s faster to do it all at once, but if that isn&#8217;t doable, and you can&#8217;t do the normal create a table copy with only what you want to keep, or use partitioning, etc., you can use this.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>While discussing a way to delete many rows, but without deleting all of them at the same time (too much transaction logging), we came up with the following&#8230; This works pretty well. It&#8217;s faster to do it all at once,&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"http:\/\/appcrawler.com\/wordpress\/2016\/01\/04\/deleting-in-a-loop-in-sql-server\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"footnotes":""},"categories":[19,34],"tags":[],"_links":{"self":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/5297"}],"collection":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/comments?post=5297"}],"version-history":[{"count":3,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/5297\/revisions"}],"predecessor-version":[{"id":5302,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/5297\/revisions\/5302"}],"wp:attachment":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/media?parent=5297"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/categories?post=5297"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/tags?post=5297"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}