Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL server 2000 - sp On Error ?
Message
De
08/07/2003 02:50:22
Rene Lovino
Bigfoot Global Solutions, Inc
Cebu, Philippines
 
 
À
08/07/2003 01:44:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00807841
Message ID:
00807852
Vues:
19
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
Fil
Voir

Click here to load this message in the networking platform