How to minimise Transaction Log

I have a database which is fed daily from parsed log files. The MSSQL transaction logs from this are huge and I don't actually need them because if there was a database error I would restore from parsing the original log files.

Is there any way I can turn off the transaction logging from within the stored procedures that are called during the parsing so that those stored procedures do not produce transaction logs ? Alternatively is there a way to minimise or shrink or truncate the transaction log before these stored procedures are called so that they will clear down before each run is made ?
MamineAsked:
Who is Participating?
 
Maciej PileckiDatabase ArchitectCommented:
You can not turn off transaction logging entirely, but you can swich the database into a Simple Recovery Model - that will truncate the transaction log automatically after the transaction is completed.
0
 
mcmonapCommented:
Hi

It is also worth assessing Bulk-logged recovery mode for your database:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adminsql/ad_bkprst_4ku1.asp

In order to remove data from your transaction logs you can run this command:
BACKUP LOG yourDBName WITH TRUNCATE_ONLY
More info here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_ba-bz_35ww.asp

To shrink the size of the transaction log file (the number represents the size in MB you wish to shrink to):
DBCC SHRINKFILE (yourDBName, 50)
More info here: http://msdn.microsoft.com/library/en-us/tsqlref/ts_dbcc_8b51.asp
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.