Catch_22
3/26/2007 4:38:00 AM
Hi,
I'm have a stored procedure running on an SQL Server 2000 database.
One particular SQL statement is failing (listed below) :
DELETE t_PaymentLN
FROM t_Payment inner join t_PaymentLN
ON t_Payment.PaymentID = t_PaymentLN.PaymentID
inner join t_StgSASummary
on t_StgSASummary.CustomerNumber = t_Payment.CustomerNumber
and t_StgSASummary.OrderNumber = t_Payment.OrderNumber
and t_StgSASummary.DetailNumber = t_Payment.DetailNumber
inner join t_AASummaries AAS1
on t_StgSASummary.BatchNumber = AAS1.BatchNumber
inner join t_AASummaries AAS2
on t_Payment.AuditAllocSummaryID = AAS2.AuditAllocSummaryID
where t_StgSASummary.responseaction = @RespAction_Payment
and t_StgSASummary.BatchNumber = @BatchNumber
and IsDate(t_Payment.DateResponse) = 0
and t_StgSASummary.[ReasonRejected] = 0
and AAS2.SNumber = AAS1.SNumber
This statement is currently causing the stored procedure to crash with
the following error message :
Msg 8624, Level 16, State 1, Procedure proc_LoadPreAllocEntries, Line
1201
Internal SQL Server error.
If I remove the last condition in the statement "and AAS2.SNumber =
AAS1.SNumber" the procedure will run without error.
Can anyone help with what might be causing this error, is it the
structure of the statement ?
I've run a DBCC CHECKTABLE on the tables as well as on the database
and they both come back OK.