VanillaGranilla icon

ListAllDatabasesBySize.sql

VanillaGranilla | PRO | 01/11/19 04:02:24 PM UTC | 0 ⭐ | 6444 👁️ | Never ⏰ | []
T-SQL |

340 B

|

None

|

0 👍

/

0 👎

SELECT
    D.name,
    F.Name AS FileType,
    F.physical_name AS PhysicalFile,
    F.state_desc AS OnlineStatus,
    (F.size*8)/1024  AS FileSizeMB,
    (F.size*8) AS SizeInBytes
FROM 
    sys.master_files F
    INNER JOIN sys.databases D ON D.database_id = F.database_id
WHERE
    D.name != 'tempdb'
ORDER BY
    FileSizeMB desc --D.name

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎