Friday 30 September 2016

Get the size of the database

With the help of below sql script we will get the size of the database on the sql server.
SELECT      sys.databases.name,
            SUM(size)*8/1024 AS [Size of database in MB]
FROM        sys.databases
JOIN        sys.master_files
ON          sys.databases.database_id=sys.master_files.database_id
GROUP BY    sys.databases.name
ORDER BY    sys.databases.name

  
We can also get the size of the database through wizard
Right click on the database and select the property
We will get the wizard

In general we will get the size of the database


No comments:

Post a Comment

If you have any doubt, please let me know.

Popular Posts