1、C#中有一个例子呀
2、使用MS DTC
3、这个是数据库的主键,它的唯一索引
4、那要在datagrid的一些event中写东西,但这样做效率很底
5、在触发器中可以得到这个ID,select id from insert

解决方案 »

  1.   

    to:楼上的
       不管触发器中的是更新,删除还是插入都要满足啊.
    to:qqqdong
    1、C#中有一个例子呀====>>在哪呀?
    5、在触发器中可以得到这个ID,select id from insert=====>>如果得到?例如我一个存储过程的内容如下:
    ALTER     proc updateBM
    @departmentid int,@name varchar(10),@peoples int
    as
      begin transaction
            declare @error int,@rowcount int
     update  部门 set name=@name,peoples=@peoples where departmentid=@departmentid
      select @error=@@error,@rowcount=@@rowcount  if @error<>0--有错误出现。
        begin
             rollback transaction
             raiserror('An error occurred updating the 部门表.The error number
    is:%d',16,1,@error)
             return 0
         end if @rowcount<>1--更新的结果如果不止一行。
       begin 
             rollback transaction
             raiserror('The update on the 部门 table didnot update 1 row.
    the error number is :%d',16,1,@rowcount)
             return 0
       end

      commit transaction
    return 1
      

  2.   

    Why there are no people to answer in here?
    Problem one and five are the defficult!I wish ones who answer it quickly!