Hola
Sugerencia, ... si lo trabajas en un procedimiento almacenado???
(como un todo, ... debo suponer que todo esta en un mismo server)
Código SQL
[-]
BEGIN TRAN
BEGIN TRY
---todas tus instrucciones
COMMIT TRANSACTION;
END TRY
BEGIN CATCH
ROLLBACK TRANSACTION
PRINT 'Se ha producido un error!!!!'
print ERROR_NUMBER() ;
print ERROR_MESSAGE() ;
END CATCH
Your friend
StartKill
Lima-Peru