Nintex Newbie

SQL Server - Sequence as Primary Key - Create Method

I need to call Create method on a SMO (based on SQL Server table). Table's primary key is set to use a database sequence. In SMO, create method primary key is flagged as required. So I must provide a value in key field while calling Create method while I want SQL Server to generate sequence and use it as primary key. 


How can I SMO Create method to use sequence that is generated at database level and not require pass to Create method when called from K2 form? Primary key is defined as Character as I have to add a string to create primary key.


0 Kudos
1 Reply
Nintex Newbie

Re: SQL Server - Sequence as Primary Key - Create Method

My recommendation would be to use a stored procedure to perform your inserts so it can leverage the database to create the new key. K2 works well with numeric Identity columns, but non-identity primary keys become required using the standard create/read/update/delete smartobject templates