I am trying to update a log table using an After Insert trigger. I can update the table with no problem, but it requires a select statement in the Trigger which attempts to return the data to the client. I am using data access pages for the client and they do no accept the returning data. I just want to update the log table and not return data. trigger sample is below.
ALTER TRIGGER [Log]
ON dbo.Prospects
FOR INSERT
AS
SET NOCOUNT ON
DECLARE @ID int, @Status int, @user nvarchar(50)
SELECT @ID=(SELECT ProspectID from Inserted),@Status=(SELECT ProspectStatus FROM Inserted),@user=(SELECT EnteredBy from Inserted)
INSERT INTO dbo.EventLog (ProspectID,ProspectStatus,UpdatedBy)
VALUES (@ID, @Status, @user)
Can anybody tell me how to stop SQL from performing the update without sending the recordset back to the client?
ALTER TRIGGER [Log]
ON dbo.Prospects
FOR INSERT
AS
SET NOCOUNT ON
DECLARE @ID int, @Status int, @user nvarchar(50)
SELECT @ID=(SELECT ProspectID from Inserted),@Status=(SELECT ProspectStatus FROM Inserted),@user=(SELECT EnteredBy from Inserted)
INSERT INTO dbo.EventLog (ProspectID,ProspectStatus,UpdatedBy)
VALUES (@ID, @Status, @user)
Can anybody tell me how to stop SQL from performing the update without sending the recordset back to the client?