Skip to main content
1-Visitor
June 23, 2016
Question

Sequence Generation with MS SQL

  • June 23, 2016
  • 0 replies
  • 705 views

Hi guys,

I recently started with Windchill 10.2 and I have the following problem:

I need a new sequence generator that will generate the sequence from 000001 to 999999. I am using the following sql script:

CREATE TABLE wt_sequence_WTTESTID (dummy CHAR(1), value BIGINT IDENTITY(000001, 1))

go

CREATE PROCEDURE wt_get_next_sequence_WTTESTID @returnValue BIGINT OUTPUT

AS

INSERT wt_sequence_WTTESTID (dummy) VALUES ('x')

SELECT @returnValue = SCOPE_IDENTITY()

go

The question is how can I set the upper limit to 999999?

Thanks,

Alex