sqlserver 查询数据库大小的方法
但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
复制代码 代码如下:
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
版权声明
本文仅代表作者观点,不代表本站立场。
本文系作者授权发表,未经许可,不得转载。
本文地址:/shujuku/MsSQL/99174.html