Wednesday, May 02, 2012
SQL - Registrar errores de carga en tabla
ALTER PROCEDURE [dbo].[spUpd_CargaDM_xxxx_FactCom-Fin]
==========*/
AS
BEGIN TRY
-- Carga Fact Finanzas y Comercial
BEGIN TRANSACTION;
EXEC usp_TW_FileNumber
EXEC usp_FactFinanzasCostos
EXEC usp_FactFinanzasFileNumber
EXEC usp_FactFinanzasMorosidad
EXEC usp_FactComercialVentas
EXEC usp_FactComercialPresupuesto
COMMIT TRANSACTION;
END TRY
BEGIN CATCH
IF XACT_STATE() <> 0
BEGIN
ROLLBACK TRANSACTION;
END
INSERT INTO Err.CargaDM(ErrorNumber,ErrorSeverity,ErrorState,ErrorProcedure,ErrorLine,ErrorMessage)
SELECT
ERROR_NUMBER() AS ErrorNumber
,ERROR_SEVERITY() AS ErrorSeverity
,ERROR_STATE() AS ErrorState
,ERROR_PROCEDURE() AS ErrorProcedure
,ERROR_LINE() AS ErrorLine
,ERROR_MESSAGE() AS ErrorMessage;
END CATCH;
/*-----------------------------------FIN---------------------------------*/
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment