views:

36

answers:

2

All,

We often delete many rows from a table and even though we are using set rowcount 10000 most of the times we fill up the Transaction Log. Is there something to do to avoid this problem happening?

Thanks,

M

A: 

before and after deleting data; you can run this query to empty transaction log:

dump tran SAMPLE_DB with truncate_only
go
Burçin Yazıcı
that only works up to SQL Server 2005 - from 2008 on, the "with truncate_only" option isn't available anymore
marc_s
Let's not see that recommended for a production database
Andrew
+1  A: 

Two things you can do:

  • you can set your database's recovery model to SIMPLE - this will limit the amount of data being logged - that's only part of a fix, however

  • you need to establish frequent transaction log backups - especially just before and just after batch deletes.

This is really more of a sysadmin/DBA question, and thus you'll probably get more and more useful answers on http://serverfault.com.

marc_s