IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[order_42_7_deletedetail]') AND type = 'P')
DROP PROCEDURE [dbo].[order_42_7_deletedetail]
GO

-- 生成时间:2017-11-28 19:19:51 by ebs-core  
CREATE  procedure order_42_7_deletedetail(
@cmpid int, 
@branchid int, 
@userdpid int, 
@useruid int, 
@userotid int, 
@jbid bigint, 
@ordid bigint, 
@ord2tag int,
@ord2id bigint
) 
as  
begin  
set nocount on 
declare @errorinfo nvarchar(4000) 
declare @operation varchar(50) 
set @operation = 'continue' 
set @errorinfo = '' 

if (@operation <> 'continue') 
begin 
-- 放弃删除
if (@errorinfo = '') set @errorinfo = 'error' 
select @operation operation, @errorinfo errorinfo 
end else 
begin 
delete order_42_7 where ord2_id = @ord2id 

select 'ok' operation, '' errorinfo 
end

set nocount off
end