Advanced Customization > Services and Infrastructure Customization > Persistence Management > Persistence Datastore Sequence Customization > Customization Points > Procedure – Creating a Non-modeled Datastore Sequence in SQLServer
  
Procedure – Creating a Non-modeled Datastore Sequence in SQLServer
When a non-modeled sequence is created, the database schema objects are not included in the Windchill introspection information. Therefore, some tools that rely on this information (e.g.Windu, upgrade tools) will treat these objects as unrelated to Windchill.
1. Create the sequence DDL script "create_<MySequence>_sequence.sql" in "<WindchillHome>/db/sqlServer" directory.
2. Add the following line to this script, substituting <MySequence>, <MySequenceSeed>, and <MySequenceIncrement>.
CREATE TABLE wt_sequence_<MySequence>(dummy
CHAR(1),
value BIGINT IDENTITY(<MySequenceSeed>, <MySequenceIncrement>))
go
CREATE PROCEDURE wt_get_next_sequence_<MySequence>
@returnValue BIGINT OUTPUT
AS
INSERT wt_sequence_<MySequence> (dummy) VALUES ('x')
SELECT @returnValue = SCOPE_IDENTITY()
go
3. Execute the sequence DDL. From a Windchill shell, execute <WindchillHome>/db/execute_sql_script.bat create_<MySequence>_sequence.sql <DB_USERNAME> <DB_PASSWORD>