Open mikeloxiao opened 5 years ago
Back in 2016, user @mgrivera posted his workaround, which was to add the hasTrigger: true
option in the model definition.
TableName = sequelize.define('TableName', {
<field definitions>
}, {
tableName: 'TableName',
hasTrigger: true
});
This workaround fixed it for me, allowing me to perform my INSERT
queries. Does this work for you?
You mean sequelize.js?
Because squel.js don't have the hasTrigger: true
option.
Yes, that is what I meant. Apologies.
If a table has a trigger in sql server, then execute update with OUTPUT will cause it to fail.
The error message is
RequestError: The target table 'tablename' of the DML statement cannot have any enabled triggers if the statement contains an OUTPUT clause without INTO clause.
More information on this problem and the workaround here: https://github.com/sequelize/sequelize/issues/4807
https://stackoverflow.com/questions/13198476/cannot-use-update-with-output-clause-when-a-trigger-is-on-the-table
Does anyone have a solution?