Skip to main content
14-Alexandrite
November 18, 2020
Solved

Change next number in wt sequence

We have several legacy files that follow a numbering scheme but are not necessarily in order. I want to change the next document number value instead (ex instead of 00010, I want it to be 00100). All the documentation points at how to CREATE a sequence, but not change it. Does anyone know how to set the value for the sequence after the table as been created?

TomUAnswer
23-Emerald IV
November 18, 2020

Each sequence has it's own table:

TomU_0-1605713391810.png

 

Each table has a column with a seed value.  This is the starting sequence number.

TomU_1-1605714591428.png

 

Changing the next number requires changing this seed value:

DBCC CHECKIDENT('<sequence name>', RESEED, <desired start number value minus 1>);

 

PTC has also documented this in the knowledge base:

https://www.ptc.com/en/support/article/CS153950

 

 

 

5 replies

23-Emerald IV
November 18, 2020

You have to change something in the database itself and I believe the approach differs depending on which database engine you are using.  Are you on SQL Server or Oracle?

Translate
Aaronm8714-AlexandriteAuthor
14-Alexandrite
November 18, 2020

We are using SQL.

Translate
1-Visitor
November 18, 2020

You have a table (named 'xxxx_seq') related to this sequence (stored procedure).

You just have to latest value in the column 'value' accordingly to what you need.

 

You could even truncate the table and insert a row with this initial value (or the one prior the needed one '99).

 

 

 

 

 

Translate