Sql Server FILESTREAM Total File Size

女生的网名这么多〃 提交于 2019-12-01 02:09:41

问题


Is there a query that would get me the total file size of the files that are in the FILESTREAM folder on the disk?


回答1:


The following query will return the length in bytes of the filestreamcolumn column:

SELECT SUM(DATALENGTH(filestreamcolumn)) FROM filestreamtable;

Source




回答2:


One disadvantage of Remus' solution is that it will not include the old versions of files that are available for garbage collection. They will no longer be part of logical database, but will still consume disk space until the Filestream garbage collector deletes them.

Starting with Sql Server 2008 R2, you can query the size column of sys.database_files for an approximate size (i.e. disk space used) of a given filestream container.



来源:https://stackoverflow.com/questions/5086603/sql-server-filestream-total-file-size

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!