Created
December 29, 2018 04:27
-
-
Save AshFlaw/1defec09de93b418715faa9c3f04c184 to your computer and use it in GitHub Desktop.
Get TempDB file group information
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 DB_NAME(mf.database_id) database_name, | |
mf.name logical_name, | |
mf.file_id, | |
CONVERT (DECIMAL (20,2), | |
(CONVERT(DECIMAL, size)/128)) as [file_size_MB], | |
CASE mf.is_percent_growth | |
WHEN 1 | |
THEN 'Yes' | |
ELSE 'No' | |
END AS [is_percent_growth], | |
CASE mf.is_percent_growth | |
WHEN 1 THEN CONVERT(VARCHAR, mf.growth) + '%' | |
WHEN 0 THEN CONVERT(VARCHAR, mf.growth/128) + ' MB' | |
END AS [growth_in_increment_of], | |
CASE mf.is_percent_growth | |
WHEN 1 THEN CONVERT(DECIMAL(20,2),(((CONVERT(DECIMAL, size)*growth)/100)*8)/1024) | |
WHEN 0 THEN CONVERT(DECIMAL(20,2),(CONVERT(DECIMAL, growth)/128)) | |
END AS [next_auto_growth_size_MB], | |
physical_name from sys.master_files mf | |
WHERE database_id = 2 AND type_desc = 'rows' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment