SQL事务写法
BEGIN TRANSACTION DeleteSupv
--SQL语句
IF @@error<>0
BEGIN
ROLLBACK TRAN DeleteSupv
GOTO on_error
END
--SQL语句
IF @@error<>0
BEGIN
ROLLBACK TRAN DeleteSupv
GOTO on_error
END
COMMIT TRAN DeleteSupv
RETURN 1
on_error:
print 'Error occured'
--SQL语句
IF @@error<>0
BEGIN
ROLLBACK TRAN DeleteSupv
GOTO on_error
END
--SQL语句
IF @@error<>0
BEGIN
ROLLBACK TRAN DeleteSupv
GOTO on_error
END
COMMIT TRAN DeleteSupv
RETURN 1
on_error:
print 'Error occured'