>>>is this to add an Upsert into vfp SQL or a wish for arbitrary backends ?
>>>On first reading impression is you don't trust the gods of Commit and Rollback.
>>>Or is your aim a solution to check, prune, fix and send bulk row operations ?
>>
>>I'm unable to massively change this system. I was mentally reserving transactions for multi-table/multi-row changes. You're right. I had not thought to wrap each insert in one. Thanks for releasing a mental block!
>>
>You are welcome - glad my visualization of what could have prompted the post was not totally off target ;-)
Hi Thomas
I'm struggling with getting sql server to return error info that I can trap with aerror. I turned on DispWarnings for the connection. I can't seem to get any raiseerror command syntax right. The SQLEXEC executable command takes this form:
DECLARE @ErrNum INT
SET @ErrNum = 0
BEGIN TRY
BEGIN TRANSACTION
select 1/0
COMMIT TRANSACTION
END TRY
BEGIN CATCH
ROLLBACK TRANSACTION
SET @ErrNum =ERROR_NUMBER()
END CATCH
IF @ErrNum < > 0
BEGIN
RAISEERROR(@ErrNum,11,-1)
END
If it returns a negative number it's only complaining about the raiseerror syntax. As I am using try/catch to decide to rollback, I think it is handling the error, so I need to raise the error for FoxPro to see it?