• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 217
  • Last Modified:

Calculating file size of a folder

Hi,

Is it possible to calculate total file size of a folder in the file system using SQL query?

I have a table that contain folder path in one of the column.

SELECT FolderPath FROM MyData

This will give result like:

\\server_A\something\folder1\
\\server_B\something\folder1\
\\server_C\something\folder3\
\\server_C\something\folder4\

I need to count the file size in each Folder Path.

Is this possible?

System is Windows 2003 server with MS SQL 2005.

Thanks.
0
klompen
Asked:
klompen
2 Solutions
 
Aneesh RetnakaranDatabase AdministratorCommented:
i wonder there is no straight forward methods
0
 
ralmadaCommented:
As indicated by Aneesh, it's cumbersome.
You could write a program in DOS and then create a temporary table with the values. Check this link as a starting point:
http://www.techtalkz.com/microsoft-sql-server/145241-calculating-folder-size-tsql.html
 
0
 
klompenAuthor Commented:
Thanks for all your answers. I thought that as well.
0

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now