My case is that I had to fix a bug from legacy, its a create operation, for that my coleague make it like this:1. SET IDENTITY_INSERT {Table_name} ON2. Do Create 3. SET IDENTITY_INSERT {Table_name} OFFThe things is in the SQL 1 & 3 he created, OutSystem consider that query as a "SQL Unlimited records in SQL Query" tech debt. In a normal case when there is SELECT query I can use a SELECT TOP 10000 to avoid that, but in this case its a SET query so I cant use TOP, so I cant resolved this tech dept. Anyone know how to fix it?, Please help!!!
@Le Duc Huy Hello, Not sure why you're doing it this way , this is just very bad practice to have you turn on Identity values before any insert then back off again.Anyways,to resolve your technical dept issue, your query should look something like this and you have to tweak the sql advance query to return the Table_name Identifier.
SET IDENTITY_INSERT {Table_name} ONDo Create SET IDENTITY_INSERT {Table_name} OFFselect top 1 SCOPE_IDENTITY()