Hi,

I want to catch sql error to not stop the DataPumpTask in DTS.
I use a stored procedure with this code :

DECLARE @TRANNAME VARCHAR(20)
SELECT @TRANNAME = 'ProcTransaction'
DECLARE @SAVENAME VARCHAR(20)
SELECT @SAVENAME = 'SavePoint'

BEGIN TRANSACTION @TRANNAME
....
SAVE TRANSACTION @SAVENAME
....
Insert into ....

SELECT @ERRORID_VAR = @@ERROR
IF @ERRORID_VAR <> 0
BEGIN
ROLLBACK TRANSACTION SavePoint
SET @ERRORDESC_VAR = 'Erreur : ' + CAST(@ERRORID_VAR AS VARCHAR) + ' .Problème lors de l''insertion de l''adresse "TTCLI" dans FOF_T_ADDRESS pour le client : ' + @IDPERSON
PRINT @ERRORDESC_VAR
SAVE TRANSACTION @SAVENAME
END
...


So with DTS my proc stop on this error and DTS package fails:

Server: Msg 515, Level 16, State 2, Procedure RB_SP_ON_TEMPTCLIENT, Line 269
Cannot insert the value NULL into column 'DC_CITY_NAME', table 'FDV_Novea_Dev.dbo.FOF_T_ADDRESS'; column does not allow nulls. INSERT fails.
Server: Msg 515, Level 16, State 1, Procedure RB_SP_ON_TEMPTCLIENT, Line 290
Cannot insert the value NULL into column 'DC_CITY_NAME', table 'FDV_Novea_Dev.dbo.FOF_T_ADDRESS'; column does not allow nulls. INSERT fails.

But when I execute my proc in Query Analyser, I have the same error but all the proc have been executed ??

In the 2 case, I want to know how can I catch errors in Transact SQL to manage them myself.

Sorry for my english