qwert231 said:
Sven Groot said:
*snip*
Well, how about a database running on SQL 2005 in SQL 2000 compatability mode?
I think I'm going to try this in my trigger statement, just to be safe:
DISABLE TRIGGER MyTriggerName ON MyTableName
... my trigger statement to update
ENABLE TRIGGER MyTriggerName ON MyTableName
(PS, why did I have to click Reply 3 times!!!?!)
Changed my triggers:
USE [AdminAppsTest]
GO
/****** Object: Trigger [dbo].[tr_ApplicantAgency_InsUpd] Script Date: 07/12/2010 12:34:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER TRIGGER [dbo].[tr_ApplicantAgency_InsUpd] on [dbo].[ApplicantAgency]
INSTEAD OF INSERT AS
INSERT INTO ApplicantAgency
(AppAgencyID, AccountTypeID, ApplicationAgencyStatusID, AgentTypeID,
InactiveDate, BusinessName, AgentNumber, FirstName, MiddleName, LastName, BusinessPhone,
HomePhone, EmailAddress, SenateDistrict, HouseDistrict, County_PK, OverShortAmount,
AvailBondAmount, NumberofDelinquencies, ApplicationFeeRcvdDate, ForwardedToRegionDate,
SecondNoticeDate, FinalAppDispositionDate, GrandOpeningShipDate, LastPaymentDate,
InitialShipDate, LastReportedDate, RejectionComment, StateParkOfficeIndicator, InternetAccount,
PALSAgent, PALSTerminal, LastUpdatedBy, LastUpdatedOn)
SELECT AppAgencyID, AccountTypeID, ApplicationAgencyStatusID, AgentTypeID,
InactiveDate, BusinessName, AgentNumber, FirstName, MiddleName, LastName, BusinessPhone,
HomePhone, EmailAddress, SenateDistrict, HouseDistrict, County_PK, OverShortAmount,
AvailBondAmount, NumberofDelinquencies, ApplicationFeeRcvdDate, ForwardedToRegionDate,
SecondNoticeDate, FinalAppDispositionDate, GrandOpeningShipDate, LastPaymentDate,
InitialShipDate, LastReportedDate, RejectionComment, StateParkOfficeIndicator, InternetAccount,
PALSAgent, PALSTerminal, LastUpdatedBy, GETDATE()
FROM Inserted i
USE [AdminAppsTest]
GO
/****** Object: Trigger [dbo].[tr_ApplicantAgency_Upd_Hist] Script Date: 07/12/2010 12:35:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER TRIGGER [dbo].[tr_ApplicantAgency_Upd_Hist] on [dbo].[ApplicantAgency]
INSTEAD OF UPDATE AS
INSERT INTO ApplicantAgencyHistory
(CreateDateTime, AppAgencyID, AccountTypeID, ApplicationAgencyStatusID, AgentTypeID,
InactiveDate, BusinessName, AgentNumber, FirstName, MiddleName, LastName, BusinessPhone,
HomePhone, EmailAddress, SenateDistrict, HouseDistrict, County_PK, OverShortAmount,
AvailBondAmount, NumberofDelinquencies, ApplicationFeeRcvdDate, ForwardedToRegionDate,
SecondNoticeDate, FinalAppDispositionDate, GrandOpeningShipDate, LastPaymentDate,
InitialShipDate, LastReportedDate, RejectionComment, StateParkOfficeIndicator, InternetAccount,
PALSAgent, PALSTerminal, LastUpdatedBy, LastUpdatedOn)
SELECT GETDATE(), AppAgencyID, AccountTypeID, ApplicationAgencyStatusID, AgentTypeID,
InactiveDate, BusinessName, AgentNumber, FirstName, MiddleName, LastName, BusinessPhone,
HomePhone, EmailAddress, SenateDistrict, HouseDistrict, County_PK, OverShortAmount,
AvailBondAmount, NumberofDelinquencies, ApplicationFeeRcvdDate, ForwardedToRegionDate,
SecondNoticeDate, FinalAppDispositionDate, GrandOpeningShipDate, LastPaymentDate,
InitialShipDate, LastReportedDate, RejectionComment, StateParkOfficeIndicator, InternetAccount,
PALSAgent, PALSTerminal, LastUpdatedBy, LastUpdatedOn
FROM Deleted d
UPDATE ApplicantAgency
SET AppAgencyID = i.AppAgencyID,
AccountTypeID = i.AccountTypeID,
ApplicationAgencyStatusID = i.ApplicationAgencyStatusID,
AgentTypeID = i.AgentTypeID,
InactiveDate = i.InactiveDate,
BusinessName = i.BusinessName,
AgentNumber = i.AgentNumber,
FirstName = i.FirstName,
MiddleName = i.MiddleName,
LastName = i.LastName,
BusinessPhone = i.BusinessPhone,
HomePhone = i.HomePhone,
EmailAddress = i.EmailAddress,
SenateDistrict = i.SenateDistrict,
HouseDistrict = i.HouseDistrict,
County_PK = i.County_PK,
OverShortAmount = i.OverShortAmount,
AvailBondAmount = i.AvailBondAmount,
NumberofDelinquencies = i.NumberofDelinquencies,
ApplicationFeeRcvdDate = i.ApplicationFeeRcvdDate,
ForwardedToRegionDate = i.ForwardedToRegionDate,
SecondNoticeDate = i.SecondNoticeDate,
FinalAppDispositionDate = i.FinalAppDispositionDate,
GrandOpeningShipDate = i.GrandOpeningShipDate,
LastPaymentDate = i.LastPaymentDate,
InitialShipDate = i.InitialShipDate,
LastReportedDate = i.LastReportedDate,
RejectionComment = i.RejectionComment,
StateParkOfficeIndicator = i.StateParkOfficeIndicator,
InternetAccount = i.InternetAccount,
PALSAgent = i.PALSAgent,
PALSTerminal = i.PALSTerminal,
LastUpdatedBy = i.LastUpdatedBy,
LastUpdatedOn = GETDATE() --i.LastUpdatedOn
FROM Inserted i, ApplicantAgency
WHERE ApplicantAgency.AppAgencyID = i.AppAgencyID
So, I get the current date/time, but I'm not triggering a trigger. (Although, Recurssive triggers was off for this database.)
Still the same issue.
I enter my data -> DB sends statements to update Transmittal row (+$$amount) and Agency row (+$$ amount) ... it works
I change my data -> DB sends statements to update Transmittal row (-$$amount) and Agency row (-$$ amount) then again update Transmittal row (+$$amount) and Agency row (+$$ amount) ... it works
I change my data -> DB sends statements to update Transmittal row (-$$amount) and Agency row (-$$ amount) then again update Transmittal row (+$$amount) and Agency row (+$$ amount) ... the subtraction doesn't go through, but the addition does!!!
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.