要是没有的话.使用LOG EXPLORER

解决方案 »

  1.   

    begin tran
       insert tb select ....
       update tb set ....
       insert tb select....
    if @@error=0
       commit
    else
       rollback
      

  2.   

    if object_id('Pepole')is not null 
       drop table Pepole
    go
    create table Pepole(ID  int identity(1,1),Name varchar(10), Sex varchar(10)check(sex in('男','女')))
    go
    begin tran
             insert Pepole select 'A', '男'
             insert Pepole select 'B', '女'
             insert Pepole select 'A', '010'
    if @@error=0
            commit
    else
           rollback
    select * from pepoleServer: Msg 547, Level 16, State 1, Line 1
    INSERT statement conflicted with COLUMN CHECK constraint 'CK__Pepole__Sex__73DA2C14'. The conflict occurred in database 'db_Study', table 'Pepole', column 'Sex'.
    The statement has been terminated.
    ID          Name       Sex        
    ----------- ---------- ---------- (0 row(s) affected)
      

  3.   

    貌似我理解错了 好像就是提交时出现异常终止后rollback
      

  4.   

    http://topic.csdn.net/u/20080321/12/f5d33007-9bea-43f1-844b-914e68de727d.html