Select SQL Server database size

前端 未结 10 949
遇见更好的自我
遇见更好的自我 2020-11-30 16:47

how can i query my sql server to only get the size of database?

I used this :

use \"MY_DB\"
exec sp_spaceused

I got this :

<
10条回答
  •  情书的邮戳
    2020-11-30 17:22

    Also compare the results with the following query's result

    EXEC sp_helpdb @dbname= 'MSDB'
    

    It produces result similar to the following

    enter image description here

    There is a good article - Different ways to determine free space for SQL Server databases and database files

提交回复
热议问题