chiplarsen
IS-IT--Management
I have a trigger that I created that I want to update my Billing_Table.DISCHARGE_DT with a value that was inserted into my DISCHARGE_TABLE. The date in the DISCHARGE_TABLE is inserted via a Bulk Insert from a txt file. The trigger parses fine, but it does not update the Billing_Table.DISCHARGE_DT field. There could be many fields that the trigger would update based on patient account numbers in each table. Here is the trigger.
Does anyone see anything that might be causing this? I also tried UPDATE in my trigger instead of INSERT. I am using MS SQL 2005. Thank you
Code:
USE [IPS_PROD]
GO
/****** Object: Trigger [dbo].[TR_DISCHARGE_INSERT] Script Date: 10/21/2009 19:59:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER TRIGGER [dbo].[TR_DISCHARGE_INSERT] ON [dbo].[DISCHARGE_TABLE] AFTER INSERT AS
BEGIN
UPDATE BILLING_TABLE SET BILLING_TABLE.DISCHARGE_DT = I.DISCHARGE_DT FROM Inserted I
INNER JOIN BILLING_TABLE ON I.PAT_ACCT_NBR = BILLING_TABLE.PAT_ACCT_NBR
END
Does anyone see anything that might be causing this? I also tried UPDATE in my trigger instead of INSERT. I am using MS SQL 2005. Thank you