Skip to main content
You are here:

How to Determine the Number of Files in PDM

When evaluating the size of a SOLIDWORKS PDM vault, one common question is, “How many files are stored in the vault?” The answer can vary depending on whether deleted files, file versions, or only active files are included in the count. 

 

This guide explains several methods to determine the number of files currently stored in a SOLIDWORKS PDM vault. Unless otherwise noted, these methods count only the active (non-deleted) files and exclude deleted files that have not yet been destroyed. Historical versions are not counted separately, meaning a file is counted once regardless of whether it has one version or one hundred versions. 

 

Jump to section: 

  •  

This method works in both SOLIDWORKS Standard and Professional and is typically the easiest approach for a quick snapshot of files. 

Advantages 

      • Available in both PDM Standard and Professional. 
      • Does not require administrative access. 

 

Limitations 

      • Large vaults may take some time to return results. 
      • Results depend on user permissions. Files the user cannot see are not counted. 

 

Steps 

  1. Open a vault view in Windows File Explorer. 
  2. Click the Search options in the SOLIDWORKS PDM task pane and select the Complete Search. 
  3. Leave all search criteria blank. 
  4. Ensure Include subfolders is enabled. 
  5. Run the search. 

The search results window displays the total number of matching items in the status bar (bottom left corner). Note this includes files and folders unless the ‘Name’ field is set to specific file extension, which the results will only show the number of items (files) for that extension. See the second image for an example of .sldprt. 

Viewing window to look in and item count

Example searching a specific project folder for .sldprt only. 

Viewing alternate example for total items

Method 2: Using Windows File Explorer Folder Properties

This method provides a quick estimate of the number of files visible in the local vault view. Note this will only display the files cached locally in the specific vault view. 

 

Advantages 

      • Very easy to perform. 
      • No special permissions required. 

 

Limitations 

      • Counts only files currently present in the local vault view. 
      • Results may vary depending on cache contents and PDM permissions. 
      • Not a reliable method for determining the total vault file count. 

 

Steps 

  1. Open the root folder of the vault view. 
  2. Right-click the vault root folder and select Properties. 
  3. Allow windows to calculate folder statistics. 
Viewing properties showing file contains

Method 3: Using SQL Query (Total Files, Files Per Type, Files Per Folder)

For administrators, querying the vault database provides the most accurate count of active files. Copy and paste the various query examples into Microsoft SQL Studio and run it against the selected vault. 

 

Jump to example: 

Example Query 1: Total Files in a vault

SELECT COUNT(DocumentID) AS [Total Number of Files] 

FROM Documents 

WHERE Deleted = 0 

View query for files in vault

Example Query 2: Files by File Type

SELECT FE.Extension, COUNT(D.DocumentID) AS NoOfDocuments, SUM(R.FileSize)/1000000 AS TotalSizeMB 

FROM Documents D 

LEFT JOIN Revisions R ON R.DocumentID=D.DocumentID AND R.RevNr=D.LatestRevisionNo — Latest revision file size only 

LEFT JOIN FileExtension FE ON FE.ExtensionID=D.ExtensionID 

  

WHERE Deleted<>1 — Only current files 

AND D.ExtensionID>1 — Exclude 

  

GROUP BY FE.Extension 

ORDER BY COUNT(D.DocumentID) DESC — use this line to sort by number of documents 

— ORDER BY SUM(R.FileSize) DESC — or use this line to sort by total filesize 

Viewing query for file type

Example Query 3: Files by Folder

SELECT P.Path, COUNT(DIP.ProjectID) AS [Number of Files]  

FROM Projects P 

JOIN DocumentsInProjects DIP ON DIP.ProjectID = P.ProjectID 

JOIN Documents D ON DIP.DocumentID = D.DocumentID 

WHERE P.FolderType = 1  

  AND D.Deleted = 0  

  AND DIP.Deleted = 0  

  AND P.Deleted = 0 

GROUP BY DIP.ProjectID, P.Path 

ORDER BY [Number of Files] DESC 

Viewing query for folders

Method 4: Using SOLIDWORKS PDM Report (PDM Professional Only)

SOLIDWORKS PDM Professional includes a built-in Report Generator that can execute formatted SQL queries and present the results. 

 

Note: To import or remove queries from the report generator, the logged in PDM user must have PDM administrative permission ‘Can update report queries.’ Once the query has been imported once, all other users will be able to access and run the query. 

 

Advantages 

      • No need to connect directly to SQL Server Management Studio. 
      • Results can be shared with other administrators. 
      • Results can be exported to CSV file. 
      • Reports can be expanded to include file types, file sizes, and other vault statistics. 

 

Limitations 

      • Requires SOLIDWORKS PDM Professional. 
      • Requires Report administrative permissions. 

 

Steps 

  1. Download example report: PDM_Current_file_count_and_size.crp 
  2. Open a PDM local vault view (File Explorer) 
  3. Select Tools > Report Generator 
  4. Select File > Import Query 
  5. Import the “PDM_Current_file_count_and_size.crp” file 
  6. Run the report. 

The report returns the total number of active files in the vault.

Viewing report example of files by file size

Understanding File Counts vs. Version Counts

A common source of confusion is the difference between files and versions. 

 

      • Files are the current active file names in the vault. 
      • Versions are digital copies of the files stored on the Archive server. The versions are linked to numerical values that can be retrieved from the Archive when getting previous versions. 

 

For example: 

File Name
Versions
Part1. Sldprt
10
Part2.sldprt
5
Drawing1.slddrw
3

The vault contains: 

      • 3 files 
      • 18 total versions (digital copies of files on the Archive server) 

 

Most reporting and sizing discussions refer to the number of files, not the number of versions or total vault size on disk. 

Vault Size on Disk / Usage

The easiest way to determine the size of your PDM vault (usage on disk) is to find the actual location of your archives. You can do this by going to the following registry location on the archive server:  

 

HKEY_LOCAL_MACHINE\SOFTWARE\SOLIDWORKS\Applications\PDMWorks Enterprise\ArchiveServer\Vaults\[Vault Name]\ArchiveTable 

 

This will give you the location of the archive folders for the vaults on your server. Navigate to the folder locations and use the folder properties to find the total size.

Viewing disk usage size examples

Summary

Method
Standard
Professional
Counts Active Files
Notes
PDM Search
Yes
Yes
Yes
User-permission Dependent
Windows Properties
Yes
Yes
Partial
Depends on local cache
SQL Query
Yes
Yes
Yes
Most Accurate
PDM Report Generator
No
Yes
Yes
Best for recurring reports

For the most accurate vault-wide file count, use a SQL query or a PDM Report. For quick estimates, a vault-wide search is usually sufficient. 

Technical Support

Get help from our team by Calling us at 800-364-1652. You can also get assistance by clicking the Technical Support button or the Email Our Experts button below. 

Scroll to Top