Created
December 10, 2018 06:37
-
-
Save kr153/74991b98aa2c27a961ffe0fe07bb654d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| with fs | |
| as | |
| ( | |
| select database_id, type, size * 8.0 / 1024 size | |
| from sys.master_files | |
| ) | |
| select | |
| name, | |
| (select sum(size) from fs where type = 0 and fs.database_id = db.database_id) DataFileSizeMB, | |
| (select sum(size) from fs where type = 1 and fs.database_id = db.database_id) LogFileSizeMB | |
| from sys.databases db ORDER BY DataFileSizeMB DESC, LogFileSizeMB DESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment