Sql-server – Backup plan for development server

backupsql-server-2012

I have some SQL servers that are used only by developers, and the developers (i.e. me) are expected to maintain them. We really don't care much about losing data, so backups are not a priority, but the transaction logs do have a tendency to fill up, slowing everyone down until I can remember how to truncate them.

Does anyone have a sample scheduled task that deals with this situation? Second best: advice on how I should write my own?

Best Answer

Set the database to simple recovery. This way the transaction log is only used during active transactions. Once transaction is committed, the active portion of the log is release and can be reused, thus minimizing log growth. Long running transactions with lot of DML will still cause the log to grow.

ALTER DATABASE DBNAME SET RECOVERY SIMPLE;