Generates SQL missing Identity

Hello all,

I have some entities created at an ERD diagram, both tables have a column marked as identity but the generated SQL for SQL Server shows the identity only for some of the tables.

An example follows:

Here cmnCountries have the column cmnCOU_UID marked as identity and the generated SQL is correct, but for cmnStates, cmnSTA_UID is marked but the SQL code does not have it.

Please note these tables does not form part of any relationship (no foreing keys).

create table dbo.cmnStates (cmnCOU_UID int not null, cmnSTA_UID int not null, cmnSTA_Name varchar(60) not null, cmnSTA_ShortName varchar(25) null, constraint PK_cmnSTA primary key (cmnCOU_UID, cmnSTA_UID));

create table dbo.cmnCountries (cmnCOU_UID int identity not null, cmnCOU_ANSICode char(2) not null, cmnCOU_Name varchar(60) not null, cmnCOU_ShortName varchar(25) null, constraint PK_cmnCOU primary key (cmnCOU_UID));

I have triple-checked and the design of the entities is correct on both cases.

Can somebody please help me?

Thanks in advance

Victor

Hello vmarquez,

Are you using ORM? ORM does not support composite-id with identity, it only generate for single primary key.

Best regards,
Jick

Hello Jick,

Thanks for your answer.

No, I am not using ORM. This is from an ERD Diagram. No ORM Diagram on my model.

Regards

Victor Marquez

Hello Victor,

This problem has been fixed already. For composite ID, native will be changed to assigned, other specific generator will be kept. But notice that by setting 2 columns to identity will cause error when executing in database.

Please run product update to advance to the latest release. You can find the updater inside the bin folder of VP Suite installation folder.

Best regards,
Jick