SQL Transaction Log

I have a database where the transaction log keeps filling up. I'm not sure this particular database really needs a transaction log. So I'm thinking of either deleting it or having it roll off automatically after two weeks.

How do I delete a transaction log and stop the logging? Also, is there a way of making a transaction roll off (drop prior logs) after two weeks automatically?

Who is Participating?
MFKConnect With a Mentor Commented:
Every database must have at least one transaction log which can be used by the SQL Server for automatic recovery. You can set the "truncate log on checkpoint" to true for the database so that every time SQL server writes committed transactions to the database these are deleted from the log.
You can enforce a checkpoint by using the DBCC Checkpoint for a particular database.
You can also truncate the log manually whenever required.
Whenever you truncate the log make sure you backup your database. Whenever a full backup is taken the transaction log can be truncated.
If you are copying large amounts of data into the database using Bulk Copy (bcp or Bulk insert) make sure that you have the option "Bulk copy/insert into.." set to true. That way the transactions are not logged, except for extent allocations which are logged by default.
You should not delete the transaction log files or you will get an error.
flfmdllAuthor Commented:
Thanks. That makes sense and helped me to get past the problem I was experiencing.
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.