Ever wanted to know what variables you have mapped in SolidWorks Enterprise PDM (EPDM)?

Here's a SQL script that will list all of the variables in your EPDM vault, their variable type, unique flag, mandatory flag, block, file extension, and what file attributes they are mapped to. This information can be very useful when troubleshooting issues such as when card or titleblock information is not being updated. Otherwise, it is a good method to document your variable setup within EPDM.

Select V.VariableName as [Variable Name],

CASE V.VariableType

WHEN '1' THEN 'Text'

WHEN '2' THEN 'Integer'

WHEN '3' THEN 'Decimal Number'

WHEN '4' THEN 'Yes or No'

WHEN '5' THEN 'Date'

END as [Type],

CASE V.FlagUnique WHEN 1 then 'Yes' ELSE '' END as [Unique],

CASE V.FlagMandatory WHEN 1 then 'Yes' ELSE '' END as [Mandatory],

CASE WHEN A.BlockName IS NULL THEN '' ELSE A.BlockName END as [Block],

CASE WHEN A.AttributeName IS NULL THEN '' ELSE A.AttributeName END as [Attribute],

Extensions = ISNULL (substring((SELECT ( ', ' + FE.Extension )

FROM AttributeExtension AE, FileExtension FE

WHERE A.AttributeID = AE.AttributeID

     AND AE.ExtensionID = FE.ExtensionID

ORDER BY AE.AttributeID, FE.Extension

FOR XML PATH( '' ) ), 3, 1000 ),'')

From Variable V

Left Join Attribute A on V.VariableID = A.VariableID

Where V.VariableType IN (1,2,3,4,5)

Order By V.VariableName

Leave a Reply