MS SQL SERVER 获取当前数据库文件等信息,适用于多个版本: 代码如下:SELECT dbf.file_id AS FileID , dbf.name AS [FileName] , s.filename AS FileLocation , CAST(dbf.size/128.0 AS DECIMAL(19,2)) AS FileSizeMB , CAST(CAST(FILEPROPERTY(dbf.name, ‘SpaceUsed’) AS int)/128.0 AS DECIMAL(19,2)) AS SpaceUsedMB , CAST(dbf