Created
August 29, 2014 18:52
-
-
Save michaeljbailey/f7a3d971a35c652e7350 to your computer and use it in GitHub Desktop.
Run this query on a server to figure out why your database log files aren't shrinking. Typically, you'll find databases that have been switch to 'Simple recovery model' but haven't had a full backup taken yet.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
[state_desc] [State], | |
[recovery_model_desc] [Recovery Model], | |
[log_reuse_wait_desc] [Log Reuse Wait Reason], | |
[name] [Database], | |
[is_auto_shrink_on] [Auto Shrink Enabled] | |
FROM [master].[sys].[databases] | |
ORDER BY [State], [Recovery Model], [Log Reuse Wait Reason], [Database] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment