I am doing a migration from Fortis to DocuWare without the tool.  I need to capture the folder values from the FTBContainer tables and possibly import them as index entries in DocuWare.  I have 30+ databases with multiple doctypes in each database.  I guess what i'm looking for is the most efficient way to query each database that will show all folder values in columns associated with the F_documentID that describe the heirarchy  (top level, level1, level2, level3, etc....) of the folders as well as the index values.   

See poorly written query attached in screenshot.

 

thanks!

https://www.docuware.com/sites/default/files/forums-images/fortis%20sample%20script_0.png