I want to query a database and create folders in PDM from it. How could I do that?
Writing to your production vault database through T-SQL is not recommended by SOLIDWORKS nor myself. You can do serious damage and no one is going to be able to help you fix it. You can achieve what you are looking for using PDM Templates. I do recommend to use the tools you are given to perform such tasks, below is a guide on how to use PDM Templates to create folders:
SOLIDWORKS PDM - Automatically Create Folders
Francisco Guzman | CSWS-DMA
Can you be more specific?
What problem are you trying to solve with query to all folders? If it is a standard folder structure that is used over and over again, then PDM template that Francisco recommended works great.
If you need to copy folder structure from like s shared network drive that was used to store files, but not copy the files, you can use drag and drop as a user that does have add/rename folders but not add/rename files. You will get a warning that it could not add the files, but it will add the folders.
To add weight to other commentators, using SQL to modify the PDM Database is UNSUPPORTED and could destroy your Vault's integrity. The only Supported way to create Folders via an external route, would be using the SolidWorks PDM API (so would require PDM Professional - as would PDM Templates)
Retrieving data ...