存储过程中使用是相同的性质吧?
我在查询分析器中测试,普通Insert 语句在增加了事务语句后也不能正常执行。

解决方案 »

  1.   

    你不要写 begin tran   
      

  2.   


    那你就不要用 连接服务器了,自己写程序同步,或者写个CLR 存储过程也行
      

  3.   

    这个问题仍然没有解决,暂时用存储过程+作业解决了.我觉得问题的原因可能在于不同VLAN之间的防火墙和不同Windows操作系统造成的兼容性问题。
      

  4.   

    Try this:
    These are the steps followed by me.1. Created Linked Server with the Server Type as SQL Server A. provided the following in the security tab i. Local Login
     ii. Remote login
     iii. Remote Password
     iv. Selected Be made using this security context option and 
    provided Remote Login & Remote Password B. Provided the following in the server options i. Checked data access
     ii. Checked RPC In
     iii. Checked RPC Out2. Checked Enforce Distributed Transaction in the source server 
    under Server Properties -> Connections 3. Started Distributed Transaction Coordinator is both the servers 
    Enabled Network DTC Access under Control Panel -> Adminstrative 
    Tools -> Component Services -> Computers -> My Computer. Right 
    click My Computer and go to properties, Go to MSDTC. Click on 
    Security configuration. Check Network DTC Access, Allow Inbound 
    and Allow Outbound in both the source and target and restarted 
    both the server (I mean the server and not sql server) 4. Then executed the query. Before I executed the query, I did SET 
    XACT_ABORT ON 
    By the way, use linked server within trigger may have performance problem. 
      

  5.   


    谢谢你的回复.Checked Enforce Distributed Transaction in the source server  
    under Server Properties -> Connections  没有找到这个项,是否Require distributed transactions for server to server communication?另外,你提到i. Local Login,是否需要设置Mapping内容?
      

  6.   

    遇到这个问题  ,服务器不再同一个Vlan
    网络说的所有的开启的都开启了 
    要是在本机没问题,在非服务器环境下的局域网(同一个VLan)也没问题,服务器就是没辙。
      

  7.   

    个人觉得用触发器应该行不通,建议在程序中实现或用SSIS来实现