链接服务器"DATASERVER"的 OLE DB 访问接口 "SQLNCLI" 返回了消息 "没有活动事务。"。 消息 0,级别 11,状态 0,第 0 行 当前命令发生了严重错误。应放弃任何可能产生的结果。 ALTER PROCEDURE [dbo].[SjSc]
AS SET XACT_ABORT ON
BEGIN TRY
BEGIN TRANSACTION;
--插入总部数据库 insert into DATASERVER.Sfl.dbo.pos_mast(lshh,rq,cardid,ontime,onhour,djbh,sktid,shky,shkyid,yishj,mx_count,je_count,jzid,fdbs,ysje,sshje,shkje,zhaol,guard_sn,copys,xiaoph,piece_count,yitiqu,beizhu ) (select lshh,rq,cardid,ontime,onhour,djbh,sktid,shky,shkyid,yishj,mx_count,je_count,jzid,fdbs,ysje,sshje,shkje,zhaol,guard_sn,copys,xiaoph,piece_count,'否' as yitiqu,beizhu from db_mast where upbs='是')
insert into DATASERVER.Sfl.dbo.pos_mxls(lshh,plh,hw,bm,xshyid,xshy,pihao,spid,shl,lshj,ysje,dj,sshje,koul,shlv,je,she,chbdj,chbje,ml,xiaoph,sktid,yishj,cardid,fdbs,fangabh,shoutpz,is_tjsp) (select lshh,plh,hw,bm,xshyid,xshy,pihao,spid,shl,lshj,ysje,dj,sshje,koul,shlv,je,she,chbdj,chbje,ml,xiaoph,sktid,yishj,cardid,fdbs,fangabh,shoutpz,is_tjsp from db_mxls where upbs='是')
insert into DATASERVER.Sfl.dbo.pos_jels(lshh,jsfsid,plh,sshje,shkje,zhaol,sktid,yishj,fdbs) (select lshh,jsfsid,plh,sshje,shkje,zhaol,sktid,yishj,fdbs from db_jels where upbs='是')
COMMIT TRANSACTION; END TRY BEGIN CATCH ROLLBACK TRANSACTION; SELECT ERROR_NUMBER() AS ERRORNUMBER END CATCH SELECT 1 AS ERRORNUMBER
本地局域网内执行不存在任何问题,使用VPN拔号上来的机器执行以上代码会报标题中的错误,如果将事务去掉单纯执行insert,VPN拔号上来的店也不报错.VPN拔号上来的店PING 服务器的名子和IP均可以PING通,MSDTC之类的检查了N遍不存在问题 求大神指点,
楼主这个问题怎么解决的?