MS SQL auto_increment field and SQLContainer

Hi,

I’ve an issue with a MS SQL table compared to a HYPERSQL one!

The MS SQL table holds a primary key like:

PK_ID INT IDENTITY(1,1),

The HYPERSQL table defines the primary key as:

PK_ID IDENTITY PRIMARY KEY,

So both are defined as AUTO_INCREMENT fields!

But the rowItem.getItemProperty(“PK_ID”).setValue(…) can only be set in the HYPERSQL version and NOT in the MSSQL one. The latter yields a readonly error!
In fact in the
HYPERSQL
case the SQLContainer has the
allowReadOnlyChange
set to
true
for its PK_ID ColumnProperty while the
MS SQL
version has the
allowReadOnlyChange
set to
false
!

Any idea how to solve this issue for MSSQL database?

Thanks in advance for your attention!

Regards,
Gerard

It sounds like you want to programatically override the increment function of your sequence. Have you checked in the database server already to set Identity_Insert OFF on that table?