This is one of those posts that is probably only useful for me. At work we have some VMs set up for general purpose development. Each dev has one assigned to them except mine is no longer mine. Hazards of leaving a job I suppose. So on my return, I've been camping out on other, less used VMs when I need to have a long running process. One of the things I notice though is that these boxes are nearly out of space.
Why? Because databases are all in FULL recovery mode. This setting makes sense in production environments but as no one is taking backups in this dev environment, this setting causes the database log files to grow and grow and grow and poof, the machines are out of disk space.
The cure, the following query will generate a row for every database in the instance in full recovery mode. I then copy and paste the results back into SSMS/sqlcmd and voila, things are fixed.
'ALTER DATABASE ' + quotename(DB.name) + ' SET RECOVERY SIMPLE WITH NO_WAIT' AS cmd
DB.recovery_model_desc = 'full';
I then shrink the log but that's ok because it never should have grown that large.