# sys db files

I have been sent some information relating to database sizes (i beleive from sys.database_files). Do you know what the information in this table is stored in, is it Mb? I want to covert the size of the DB into Gb, so firstly knowing what it represents would help.
LVL 4
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MSSQL Senior EngineerCommented:
Did you try to see in MSDN?
All columns are descripted there. The sizes are in 8-KB pages format so you need to use the following formula to get in GB: size * 8 * 1024 * 1024 (KB * MB * GB).
Author Commented:
Thanks... but that formula cant be right? Arent the last 2 /'s of 1024?
MSSQL Senior EngineerCommented:
Sorry. I couldn't understand your question now but I'll try to explain in other words.

The size field stores the number of pages that the file has. In SQL Server is page has 8KB so you need to multiply the number in size field by 8 so you can have the result in KB. Then you multiply it by 1024 (1MB = 1024KB) and after you need to multiply again by 1024 (1GB=1024MB).
No points, just clarifying Vitor's statements:
The data is stored in 8k page files. To convert to GB, you need to divide by 128 (to get to MB) and then divide by 1024 (to get to GB). Another way of looking at it is:
8k_size_page_count * 8 (to get to KB) / 1024 (to get to MB) / 1024 (to get to GB)
MSSQL Senior EngineerCommented:
Oh yes, now I understood the pma111 question.
I don't know why I was so focus in the multiplication. Should be division :)

Thanks Shaun for the correction.

So, should be size * 8 / 1024 / 1024 (KB --> MB --> GB).

Experts Exchange Solution brought to you by