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)
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only