Trigger that is inserted into the linked table causing the error

I am having a problem with a trigger that inserts a value into the same message on a linked server. Here is the trigger in question ...

USE [localDB]
GO
/****** Object:  Trigger [dbo].[INS_New_Row]    Script Date: 05/26/2009 10:50:56 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:      <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
ALTER TRIGGER dbo.INS_New_Row
   ON  LOCALDB.dbo.WIQ
   AFTER INSERT
AS 
BEGIN
    INSERT INTO
        DRSERVER.LOCALDBCLONE.dbo.WIQ
    SELECT
              column1,
              column2,
              column3
    FROM
        inserted
END

      

When I insert a line into LOCALDB.dbo.WIQ from my application, I get the following error ...

System.Data.SqlClient.SqlException: The target WIQ DML table cannot include triggers if the statement contains an OUTPUT without an INTO clause.

The problem is that I don't have any OUTPUT clauses on this (or any other) trigger defined on the table, and the target table has no triggers defined on it.

I am not sure why I am getting this error. Strange thing: if I insert values ​​into columns from SQL Server Management Studio, the trigger works fine and the row is duplicated in DRSERVER, it's only from the application that gets the error.

This application is a Windows service written in C # that inserts strings into LOCALDB.dbo.WIQ.

Thanks,

Scott Verkuski

+1


a source to share


1 answer


As it turned out, one of the components that was called from my application included a stored procedure that inserted data into a table and had an OUTPUT clause in it. I didn't know that this particular component was functioning and I was able to make changes to ease the error.



Thanks to everyone who read / thought about my question.

0


a source







All Articles