Upgrade Guides for Genero BDL / 2.40 upgrade guide |
SERIAL type emulation has been enhanced for SQL Server.
Before version 2.40, the SQL Server drivers (SNC, MSV, ESM, FTM) were using the @@IDENTITY expression to retrieve the last generated identity column, if the native serial emulation is configured. But @@IDENTITY is not recommended, because it can return an identity value generated for another table in a trigger of the main table.
Starting with 2.40, the SQL Server drivers use the SCOPE_IDENTITY() function, which returns the last number generated in the current scope (ignoring identity numbers generated in triggers).
When using the "regtable" serial emulation, the code of the triggers has changed in version 2.40, using now the SET NOCOUNT ON instruction. Existing serial triggers created by prior versions must be reviewed, to have the same trigger body in all tables, otherwise an SQL error is raised when executing INSERT statements.