但Insus.NET想到的是,從下面的SQL語句,就可以查詢到數據庫大小。因此分享於此。
復制代碼 代碼如下:
SELECT DB_NAME(database_id) AS [Database Name],[Name] AS [Logical Name],[Physical_Name] AS [Physical Name],((size * 8) / 1024) AS [Size(MB)],[differential_base_time] AS [Differential Base Time]
FROM sys.master_files
WHERE DB_NAME(database_id) IN('XXX')
GO