Sql Server FILESTREAM Total File Size

Is there a request that will give me the total size of the files located in the FILESTREAM folder on the disk?

+6
sql-server filestream
source share
2 answers

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

 SELECT SUM(DATALENGTH(filestreamcolumn)) FROM filestreamtable; 

A source

+12
source share

One of the drawbacks of the Remus solution is that it will not include older versions of the files that are available for garbage collection. They will no longer be part of the 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 sys.database_files size column for the approximate size (i.e., used disk space) of this container for storing files.

+5
source share

All Articles