Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 doc mgmt - counting files

Author  Topic 

webhed
Starting Member

1 Post

Posted - 2004-05-27 : 05:05:26
I'm building a document mgmt system and I want to be able to report the number of files in a folder and its sub-folders. I have a Folders table and a Documents table. Within the Folders table I have a field that stores the no of files in that particular folder (not its subfolders). So to find the number of files in a specific folder is dead easy. I'm a bit stumped by how to add up the files for all the subfolders though. I'm sure this involves recursion somehow, but how exactly would I write this query/sp?

TIA
nic.

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2004-05-27 : 05:34:05
search here for hierarchies.....there are several topics on this, which should get you moving.
Go to Top of Page
   

- Advertisement -