You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An exception is thrown when the AuditEntry table has a trigger.
We're using Azure SQL database.
2. Exception
Microsoft.Data.SqlClient.SqlException (0x80131904): The target table 'AuditEntrySet' of the DML statement cannot have any enabled triggers if the statement contains an OUTPUT clause without INTO clause.
Exception message:
Failed executing DbCommand (0ms) [Parameters=[@p0='?' (Size = 255), @p1='?' (DbType = DateTime2), @p2='?' (Size = 255), @p3='?' (Size = 255), @p4='?' (DbType = Int32), @p5='?' (Size = 255)], CommandType='Text', CommandTimeout='30']
SET IMPLICIT_TRANSACTIONS OFF;
SET NOCOUNT ON;
INSERT INTO [AuditEntrySet] ([CreatedBy], [CreatedDate], [EntitySetName], [EntityTypeName], [State], [StateName])
OUTPUT INSERTED.[AuditEntryID]
VALUES (@p0, @p1, @p2, @p3, @p4, @p5);
An exception occurred in the database while saving changes for context type 'DataContext'.
Microsoft.EntityFrameworkCore.DbUpdateException: Could not save changes because the target table has database triggers. Please configure your entity type accordingly, see https://aka.ms/efcore-docs-sqlserver-save-changes-and-triggers for more information.
---> Microsoft.Data.SqlClient.SqlException (0x80131904): The target table 'AuditEntrySet' of the DML statement cannot have any enabled triggers if the statement contains an OUTPUT clause without INTO clause.
at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at Microsoft.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
at Microsoft.Data.SqlClient.SqlDataReader.get_MetaData()
at Microsoft.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
at Microsoft.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean isAsync, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
at Microsoft.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry, String method)
at Microsoft.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at Microsoft.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)
at Microsoft.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReader(RelationalCommandParameterObject parameterObject)
at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.Execute(IRelationalConnection connection)
ClientConnectionId:1de58170-c583-49ad-8a4e-8e063c0dee79
Error Number:334,State:1,Class:16
--- End of inner exception stack trace ---
The text was updated successfully, but these errors were encountered:
The current bug (unless this is something else in your case) is not related to our library as you can reproduce the same behavior by simply adding a row to this table and calling the SaveChanges.
1. Description
An exception is thrown when the AuditEntry table has a trigger.
We're using Azure SQL database.
2. Exception
Microsoft.Data.SqlClient.SqlException (0x80131904): The target table 'AuditEntrySet' of the DML statement cannot have any enabled triggers if the statement contains an OUTPUT clause without INTO clause.
The text was updated successfully, but these errors were encountered: