Determine SQL Server Database Size

后端 未结 8 1573
野性不改
野性不改 2020-12-07 22:34

SQL Server 2005/2008 Express edition has the limitation of 4 GB per database. As far as I known the database engine considers data only, thus excluding log files, unused spa

相关标签:
8条回答
  • 2020-12-07 23:10

    In SQL Management Studio, right-click on a database and select "Properties" from the context menu. Look at the "Size" figure.

    0 讨论(0)
  • 2020-12-07 23:12

    Common Query To Check Database Size in SQL Server that supports both Azure and On-Premises-

    Method 1 – Using ‘sys.database_files’ System View

    SELECT
        DB_NAME() AS [database_name],
        CONCAT(CAST(SUM(
            CAST( (size * 8.0/1024) AS DECIMAL(15,2) )
        ) AS VARCHAR(20)),' MB') AS [database_size]
    FROM sys.database_files;
    

    Method 2 – Using ‘sp_spaceused’ System Stored Procedure

    EXEC sp_spaceused ;
    
    0 讨论(0)
提交回复
热议问题