垃圾事务

USE AdventureWorks;
GO
BEGIN TRANSACTION;
GO
UPDATE Person.Contact
    SET LastName = '1111'
    WHERE LastName = 'Wood';
GO
IF @@TRANCOUNT > 0
BEGIN
    PRINT N'A transaction needs to be rolled back.';
    ROLLBACK TRANSACTION;
END
select LastName  from Person.Contact  WHERE LastName = 'Wood';

posted @ 2011-09-20 13:20  qanholas  阅读(127)  评论(0编辑  收藏  举报