Posting or Creating a record on service that uses KNEX and MSSQL & that table has triggers on insert will cause a 500 error
The target table 'payrollemployees' of the DML statement cannot have any enabled triggers if the statement contains an OUTPUT clause without INTO clause.",
(First please check that this issue is not already solved as described
here - if it is a general question or suggestion please start a Discussion)
Expected behavior
There are two solutions either to disable the triggers on all affected tables OR
in knex Docs
// Adding the option includeTriggerModifications
// allows you to run statements on tables
// that contain triggers. Only affects MSSQL.
knex('books')
.insert(
{title: 'Alice in Wonderland'},
['id'],
{ includeTriggerModifications: true }
)
Tell us what should happen
i hope there is a way to include this { includeTriggerModifications: true } globally on driver level or at least service level instead of writing a custom service or disable triggers
PS: i think the problem propagates to other service methods but i did not test for that
Steps to reproduce
Posting or Creating a record on service that uses KNEX and MSSQL & that table has triggers on insert will cause a 500 error The target table 'payrollemployees' of the DML statement cannot have any enabled triggers if the statement contains an OUTPUT clause without INTO clause.", (First please check that this issue is not already solved as described here - if it is a general question or suggestion please start a Discussion)
Expected behavior
There are two solutions either to disable the triggers on all affected tables OR in knex Docs
Tell us what should happen
i hope there is a way to include this { includeTriggerModifications: true } globally on driver level or at least service level instead of writing a custom service or disable triggers
PS: i think the problem propagates to other service methods but i did not test for that