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

Change next number in wt sequence

  • November 18, 2020
  • 1 reply
  • 2875 views

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?

Best answer by TomU

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

 

 

 

1 reply

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?

Aaronm8714-AlexandriteAuthor
14-Alexandrite
November 18, 2020

We are using SQL.

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).