日期:2014-05-18 浏览次数:20773 次
CREATE TRIGGER [nmtohrb] ON [dbo].[recfiles] FOR INSERT AS Begin Insert into OPENDATASOURCE('SQLOLEDB','Data Source=www.baidu.com;User ID=sa;Password=XXX').aaa.dbo.recfiles select * from inserted End
--加上下面两句,否则会提示新事务不能登记到指定事务处理器 set xact_abort on begin distributed tran
------解决方案--------------------
CREATE TRIGGER [nmtohrb] ON [dbo].[recfiles] FOR INSERT AS begin --少了个begin set xact_abort on begin distributed tran Insert into OPENDATASOURCE('SQLOLEDB','Data Source=www.baidu.com;User ID=sa;Password=XXX').aaa.dbo.recfiles select * from inserted End