USE [SZUM_ZHZF_ExChange]
GO
/****** 对象: StoredProcedure [dbo].[p_copy_trspdb_t_xzzf_pz] 脚本日期: 09/15/2009 10:51:03 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[p_copy_trspdb_t_xzzf_pz]
--WITH ENCRYPTION
AS
BEGIN
SET NOCOUNT ON
BEGIN TRANSACTION;
declare @t_trsp_id table (zjid uniqueidentifier)
/*搜索未同步的ID*/
insert into @t_trsp_id
select id from SZUM_ZHZF_ExChange.dbo.t_case_stage_suggestion
where
cast(id as varchar(100))
not in
(
select zjid from v_ora_T_XZZF_TRSP_ID
where HJ='t_xzzf_pz'
)
and (acitivity_id='8a540876-88c2-47a6-9567-9ac0010550c4'
or acitivity_id='e5536807-fd17-4941-9969-9ac0010562df' ) --副队长审核/大队长审核
/*删除未同步过的数据,重新同步*/
delete from SZUM_ZHZF_ExChange.dbo.t_case_stage_suggestion
where
id in
(select zjid from @t_trsp_id)
and (acitivity_id='8a540876-88c2-47a6-9567-9ac0010550c4'
or acitivity_id='e5536807-fd17-4941-9969-9ac0010562df' ) --副队长审核/大队长审核
/*重新同步*/
insert into SZUM_ZHZF_ExChange.dbo.t_case_stage_suggestion
select * from SZUM_ZHZF_IntergratedPlatform.dbo.t_case_stage_suggestion
where
id in
(select zjid from @t_trsp_id)
and (acitivity_id='8a540876-88c2-47a6-9567-9ac0010550c4'
or acitivity_id='e5536807-fd17-4941-9969-9ac0010562df' ) --副队长审核/大队长审核
COMMIT TRANSACTION;
END
GO
------------------------------------------------------------------------------------
链接服务器"ZHZF_EXCHANGE_SQL2000"的 OLE DB 访问接口 "SQLNCLI" 返回了消息 "不能在手动或分布事务模式下创建新的连接。"。
消息 7320,级别 16,状态 2,第 1 行
无法对链接服务器 "ZHZF_EXCHANGE_SQL2000" 的 OLE DB 访问接口 "SQLNCLI" 执行查询"SELECT 1 FROM "XZZF"."dbo"."t_xzzf_trsp_id" "Tbl1005" WHERE "Tbl1005"."ZJID" IS NULL AND "Tbl1005"."HJ"='t_xzzf_pz'"。
------------------------------------------------------------------------------------
至今还不知道这是为什么?