Hello all,
I am trying to write a store procedure on SQL server and I am looking a semilar ON ERROR command of VFP.
Example :
VFP code
========
nErrorFlag = 0
ON ERROR nErrorFlag = 1
APPEND from .... type delimited with ..
IF nErrorFlag = 1
MESSAGEBOX('Error When Appending')
RETURN
ENDID
Note : the above code cover also the case of corrupted or bad structure incoming files
In SQL Server SP I am using BULK INSERT command. How can be sure that what when something goes wrong the SP will not Stop ?
Thanks in Advance
Petros
Use the system variable @@ERROR
example:
if @@ERROR <> 0
Print 'Error When Appending'
or
if @@ERROR <> 0
RAISERROR ('Error When Appending', 16, 1)
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement