- Please select -

Finding Duplicate File Names in PDM Pro/Std Vault Using a SQL query

Tips and Tricks Peter 2 August 2017

Finding Duplicate File Names in PDM Pro/Std Vault Using a SQL query

There may be occasions where you need to check for duplicate file names in a PDM Pro/Std vault.

This may be because initially duplicate file names were allowed but the current position is that all files must have unique names.

This setting can be specified as an overall one, or for different file extensions. Ie you can restrict duplicate file names for just a pdf file for instance.

Solidworks PDM Administration

pdm pro/std

If you wanted to check the vault for duplicate file names the best and quickest way to do this is via a SQL query.

In the image below you can see the query to use (I will copy the text below for reference) You select the vault database on which you wish to run it and then execute the query.

You can see it finds 4 files in my quickstart vault called Part1.sldprt
Finding duplicate file names in pdm pro/std vault using a sql query

Microsoft SQL Server Management Studio

Below is the text from the query you can copy and paste as required into a new SQL query in your SQL Management Studio,

Select D.DocumentID, D.FileName AS [File Name], P.Path AS [Project Path]
From Documents AS D
INNER JOIN DocumentsInProjects AS DIP ON D.DocumentID = DIP.DocumentID
FULL OUTER JOIN Projects P ON DIP.ProjectID = P.ProjectID
WHERE D.Filename IN (Select Filename FROM Documents Where Deleted = 0
GROUP BY Filename
HAVING (COUNT (Filename) >1))
ORDER BY D.Filename



Back to Tips and Tricks