2
我已爲Sharepoint實施Blob存儲。下面的代碼工作,我想確保它計數blobs驅動器上的文件流。SQL - 獲取數據庫大小
SELECT [Database Name] = DB_NAME(database_id),
[Type] = CASE WHEN Type_Desc = 'ROWS' THEN 'Data File(s)'
WHEN Type_Desc = 'LOG' THEN 'Log File(s)'
ELSE Type_Desc END,
[Size in MB] = CAST(((SUM(Size)* 8)/1024.0) AS DECIMAL(18,2))
FROM sys.master_files
-- Uncomment if you need to query for a particular database
-- WHERE database_id = DB_ID(‘Database Name’)
GROUP BY GROUPING SETS
(
(DB_NAME(database_id), Type_Desc),
(DB_NAME(database_id))
)
ORDER BY DB_NAME(database_id), Type_Desc DESC
GO
感謝ryguy7272。我會測試腳本並讓你知道。我很感激。 –