cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Change next number in wt sequence

Aaronm87
14-Alexandrite

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?

ACCEPTED SOLUTION

Accepted Solutions
TomU
23-Emerald IV
(To:Aaronm87)

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

 

 

 

View solution in original post

5 REPLIES 5
TomU
23-Emerald IV
(To:Aaronm87)

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?

Aaronm87
14-Alexandrite
(To:TomU)

We are using SQL.

Florent
15-Moonstone
(To:Aaronm87)

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

 

 

 

 

 

Florent ROUSSEL
www.4cad.ca
TomU
23-Emerald IV
(To:Aaronm87)

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

 

 

 

Aaronm87
14-Alexandrite
(To:TomU)

Exactly what I needed! Thanks for the quick reply!

Announcements

Top Tags