2018年5月16日 星期三

Listing information about all database files in SQL Server in MB size

https://stackoverflow.com/questions/43472717/get-actual-database-size-in-sql-server-2012-in-gb
https://stackoverflow.com/questions/27057000/sql-server-get-all-databases-with-mdf-and-ldf-file-location

SELECT
    db.name AS DBName,
    type_desc AS FileType, size * 8/1024 AS MBSize,
    Physical_Name AS Location
FROM
    sys.master_files mf
INNER JOIN 
    sys.databases db ON db.database_id = mf.database_id

Table Size
https://stackoverflow.com/questions/7892334/get-size-of-all-tables-in-database


Here is another method: using SQL Server Management Studio, in Object Explorer, go to your database and select Tables




Then open the Object Explorer Details (either by pressing F7 or going to View->Object Explorer Details). In the object explorer details page, right click on the column header and enable the columns that you would like to see in the page. You can sort the data by any column too.

沒有留言:

張貼留言

注意:只有此網誌的成員可以留言。