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 :
Also compare the results with the following query's result
EXEC sp_helpdb @dbname= 'MSDB'
It produces result similar to the following
There is a good article - Different ways to determine free space for SQL Server databases and database files