IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[order_172_dolinkdata_1717]') AND type = 'P')
DROP PROCEDURE [dbo].[order_172_dolinkdata_1717]
GO
create procedure order_172_dolinkdata_1717(
@cmpid int ,
@useruid int ,
@bizid int ,
@ordbcid int,
@ordid bigint,
@jbid bigint,
@ftype varchar(10),
@fbizid int,
@fordid bigint,
@ford2tag int ,
@ford2id bigint,
@rtype varchar(10),
@rbizid int,
@rordid bigint,
@rord2tag int ,
@rord2id bigint 
) 
as 
begin
declare @operation varchar(50) 
declare @errorinfo nvarchar(4000)  
declare @newobjid bigint 
declare @ident varchar(40) 
declare @newsql nvarchar(max) 
declare @condition nvarchar(4000) 
declare @bcid int 
set @bcid=@ordbcid 



set @operation = 'continue' 
set @errorinfo='' 
set @newobjid = 0 
set @ident=convert(varchar(100),convert(decimal(18,11),CURRENT_TIMESTAMP)) 
set @newsql = '' 
set @condition = '' 
-- 以下是用户扩展的程序  ---- 

-- 以上是用户扩展的程序  ---- 
if (@operation = 'continue') 
begin 

set @newsql='
update old set  old.ord_htbh=new.ord_htbh
from order_172 new ,order_188 old 
where  new.ord_id=@ordid 

'
if (@condition>'') set @newsql=@newsql+' and ('+@condition+') ' 

exec sp_executesql @newsql, N'@ordid bigint', @ordid 
end 



set @operation = 'continue' 
set @errorinfo='' 
set @newobjid = 0 
set @ident=convert(varchar(100),convert(decimal(18,11),CURRENT_TIMESTAMP)) 
set @newsql = '' 
set @condition = '' 
-- 以下是用户扩展的程序  ---- 

-- 以上是用户扩展的程序  ---- 
if (@operation = 'continue') 
begin 

set @newsql='
update old set  old.ord_htbh=new.ord_htbh
from order_172 new ,order_93 old 
where  new.ord_id=@ordid 

'
if (@condition>'') set @newsql=@newsql+' and ('+@condition+') ' 

exec sp_executesql @newsql, N'@ordid bigint', @ordid 
end 

--- 下面这段程序，是完成帐务处理------

--- 帐务处理完毕 ------

end