In SOLIDWORKS PDM Professional, serial numbers can go a long way to helping us add some intelligence to our part numbering scheme. For example, using multiple pieces to create a naming format that includes a month or a year can help us organize our data.
There isn’t a way to reset a serial number value automatically inside SOLIDWORKS PDM. However, we can accomplish this by using the SQL Server Agent to create a scheduled job to alter these values.
Warning: The following actions should be taken by individuals knowledgeable in SQL. The PDM environment should be backed up before taking any of the following actions.
Log into SQL Server Management Studio (SSMS) as an administrator. Navigate to the SQL Server Agent node near the bottom of the Object Explorer. Then, right-click the Jobs folder and choose New Job... to create a new job. Give the job a name, such as Monthly Serial Reset.
Select Steps in the tree and click New... at the bottom of the dialog box. We’ll only need one step in this process. Give the step a name, such as SQL Script.
Using the database dropdown, select your PDM database. Put the SQL script that you’d like to run below in the Command space. Here, we will use a simple script to reset a serial to zero. An example of this is below, but note your values may be different.
To determine the values, we can use SSMS to look at the SerialNumberID for the serial we’d like to affect. This is in the SerialNumbers table. A script for this would look like the below query. The results will provide us with columns for name and ID. Use the appropriate ID for the serial number counter you wish to reset in the query above.
Click OK to add this step.
Next, we’ll set up the schedule. Select the Schedules page in the left column and click New to add a new scheduling step. Give the schedule a name and make the selections to repeat this job. Here, we’ll configure this to run on the first of the month each month.
Click OK to complete the schedule and OK again to complete the job setup.
I hope you found this article discussing resetting SOLIDWORKS PDM Serial Numbers automatically helpful. Check out more articles below. Additionally, join the GoEngineer Community to participate in the conversation, create forum posts, and answer questions from other SOLIDWORKS users.
SOLIDWORKS PDM Data Card Find User Button Control
SOLIDWORKS PDM: Create and Deploy a Local View File
Implementing a Change Form in SOLIDWORKS PDM Professional
SOLIDWORKS PDM: Input Formula Aliases
About Bryce Hooper
Bryce has been using SOLIDWORKS since 2008 in multiple roles across multiple industries from industrial vacuum to RV frame design. He spent many of those years spent as a PDM administrator, implementing 3 PDM vaults along the way. He earned his CSWP in 2019, followed by his CSWE in 2013. Programming is a passion that has followed Bryce through his various positions, writing custom business applications to improve design processes. In his spare time Bryce is a gamer, a maker, and a brewer.
Get our wide array of technical resources delivered right to your inbox.
Unsubscribe at any time.