SQL事务
DECLARE @SSL_ERR INT,@RP_ERR INT
BEGIN TRANSACTION
UPDATE info SET text='my text' WHERE id=1
SET @SSL_ERR=@@ERROR
UPDATE info SET info='my info' WHERE id=1
SET @RP_ERR=@@ERROR
IF @SSL_ERR=0 AND @RP_ERR=0
COMMIT TRANSACTION
ELSE
ROLLBACK TRANSACTION
学习资料:sqlserver事务与回滚