Hi all,
I verified (in multiple environments) that if I use a method like this one below, with the transact-SQL SET NOCOUNT ON, I obtain, systematically, while accessing clients or while running CIL Incremental compilation, a misalignment on the SYSTEMSEQUENCES table only for the USERDATAAREAFILTER and SYSCOMPILEILTABLE values, the NextVal is increased to MaxVal, wrongly.
Consequences: the users are stopped at AX starting (very bad !). Incremental CIL cannot be executed.

public static server void ExecuteQueryUpdate()
{
Connection connection = new Connection();
Statement statement = connection.createStatement();
str query;
;
query = @" SET NOCOUNT ON
;
TRUNCATE TABLE Table1
;
INSERT INTO [dbo].[Table1]
([FIELD1],[DATAAREAID],[RECVERSION],[PARTITION],[RECID])
VALUES
('ciao', 'dat', 1, 5637144576, 1)
;
INSERT INTO [dbo].[Table1]
([FIELD1],[DATAAREAID],[RECVERSION],[PARTITION],[RECID])
VALUES
('ciao', 'dat', 1, 5637144576, 2)
;
--INSERT 3
;
--UPDATE 1
;
--INSERT 4
;
-- etc.. ";
new SqlStatementExecutePermission(query).assert();
statement.executeUpdate(query);
CodeAccessPermission::revertAssert();
}
Note: the method works correctly and executes the SQL statement correctly.
Important: please note that if I use the same query, with SET NOCOUNT OFF, nothing about happens.
Any ideas for the specific reason?