0

I am using SQL Server 2014 with SSDT BI for Visual Studio 2013. When I execute the below query in the SSIS Execute SQL Task I get this error.

"[Execute SQL Task] Error: Executing the query "IF OBJECT_ID ('[DIMDB].[dbo].[Test..." failed with the following error: "The transaction ended in the trigger. The batch has been aborted."."

The below query works fine in SSMS but fails in SSIS Execute SQL Task.

Query:

IF OBJECT_ID ('[DIMDB].[dbo].[Test]', N'U') IS NOT NULL

BEGIN
DROP TABLE [dbo].[Test]
END;


CREATE TABLE [dbo].[Test](
    [Id] [int] IDENTITY(1,1) NOT NULL,
    [Description] [varchar](255) NULL
);
ITHelpGuy
  • 969
  • 1
  • 15
  • 34
  • You need to find the trigger that it is triggering. I guess it might be a database level DDL trigger. In SSMS under your database, go take a look at Programability / Database triggers and see if there is one there. Possibly your package is running as a different user or there is some other circumstance which is not obvious. – Nick.Mc Oct 26 '16 at 01:20
  • We would have to see your trigger in order to help. – Tab Alleman Oct 26 '16 at 12:49
  • Possible duplicate of [The Transaction Ended In The Trigger The Batch Has Been Aborted](https://stackoverflow.com/questions/17941161/the-transaction-ended-in-the-trigger-the-batch-has-been-aborted) – underscore_d Dec 28 '17 at 11:00

0 Answers0