Sql – DB file size from master..sysaltfiles

sql serversql-server-2005tsql

I'm trying to retrieve db sizes of all databases in my SQL Server 2005 instance. I found this

select filename, size, 8192.0E * size / 1048576.0E as result
from master..sysaltfiles

Is the result varibale in KB? How can get this to MB? I'm confused.

Best Answer

The result must be in MB. I tried your query and have result size in MB.