DML statement cannot have any enabled triggers if the statement contains an OUTPUT clause without INTO clause
See original GitHub issueIssue type:
[ ] question [x] bug report [ ] feature request [ ] documentation issue
Database system/driver:
[ ] cordova
[ ] mongodb
[x] mssql
[ ] mysql
/ mariadb
[ ] oracle
[ ] postgres
[ ] cockroachdb
[ ] sqlite
[ ] sqljs
[ ] react-native
[ ] expo
TypeORM version:
[x] latest
[ ] @next
[ ] 0.x.x
(or put your version here)
Steps to reproduce or a small repository showing the problem:
I have tried to insert Person into MSSQL table which contains one trigger, and I have run into this exception:
The target table \'Person.person\' of the DML statement cannot have any enabled triggers if the statement contains an OUTPUT clause without INTO clause.
Typeorm tried to execute this query:
exec sp_executesql @statement=N'INSERT INTO "Person"."person"("FirstName", "LastName", "Title") OUTPUT INSERTED."BusinessEntityID" VALUES (@0, @1, @2)',@params=N'@0 nvarchar(50), @1 nvarchar(50), @2 nvarchar(8)',@0=N'Alija',@1=N'Bobija',@2=N'Mr.'
I have used database AdventureWorks2017
that is open source and available on Microsoft online websites.
This is my Person
entity:
@Entity({
schema: 'Person'
})
export default class Person extends BaseEntity {
@PrimaryGeneratedColumn({
name: 'BusinessEntityID'
})
Id!: number;
@Column({
length: 50
})
FirstName! : string;
@Column({
length: 50
})
LastName!: string;
@Column({
length: 8
})
Title!: string;
}
And this is my code for adding new person:
await Person.insert({
FirstName: 'Alija',
LastName: 'Bobija',
Title: 'Mr.'
});
Best regards
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Cannot use UPDATE with OUTPUT clause when a trigger is ...
Given the kludge needed to make UPDATE with OUTPUT work in SQL ... triggers if the statement contains an OUTPUT clause without INTO...
Read more >The target table of the DML statement cannot have ... - GitHub
The target table of the DML statement cannot have any enabled triggers if the statement contains an OUTPUT clause without INTO clause. #4535....
Read more >SQL Server Error Messages - Msg 334
... The target table '<Table Name>' of the DML statement cannot have any enabled triggers if the statement contains an OUTPUT clause without...
Read more >DML statement cannot have any enabled triggers if the ...
DML statement cannot have any enabled triggers if the statement contains an OUTPUT clause without INTO clause. Cause: With version 9.5.6.0 a new ......
Read more >Error when submitting "new" form to SQL
of the DML statement cannot have any enabled triggers if the statement contains an OUTPUT clause without INTO clause.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi, sorry for late response. @sgarner thank you very very much for this contribution! Now I can finally continue with my project, woohoo! 👍
I made a PR: https://github.com/typeorm/typeorm/pull/5361