Skip to content

Sharepoint dev machine – keep your SQL databases sizes neat

May 30, 2016

Ok, time to go back to the blog posting.


I do often create single-server SharePoint based environments purely for development purposes. In this environment we often face an issue of overgrowing databases logs.

To make things worse, now I use SSDs in Azure, which are rather limited in size.

So for DEVELOPER machine it would be fine to switch the recovery model to simple and thus the log should be truncated.

Prior to SQL 2012, there was a special option “truncate log on checkpoint”, but as of SQL 2012 I cannot find this option anymore. See


The blog here contains a good set of commands to keep your database in place (I really like the title “Shrinking Ginormous SharePoint Database Transaction Log Files” :)), but it only deals with one database.


So I have found an undocumented procedure sp_MSForEachDB (you could read more here or here ) that can run a particular command on every database.


The final syntax I use comes like this (but, of course, you could use your commands and avoid shrinking or set autoshrink if it suits your environment).



Disclaimer: I am not in any case saying that simple recovery model is ok for production.

Hope this post would be useful.



From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: