sqlserver 简单的事物用法
SELECT * FROM Interface_UserPort BEGIN TRY BEGIN TRAN Tran_2012_12_25 INSERT INTO dbo.Interface_UserPort VALUES(2,3) --raiserror 50005N'抛出错误' COMMIT TRAN Tran_2012_12_25 END TRY BEGIN CATCH raiserror 50005N'出错了' ROLLBACK TRAN Tran_2012_12_25 END CATCH