Spider024

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

 

create function [dbo].[GetOperateCustGroup] 
( 
 @CustomerGuid varchar(36), 
 @StrategyOperateId varchar(36)
)
returns @TempTable table (MaxPrice float,MinPrice float,[Percent] float)        
AS
begin
declare @CustomerGroupId int

select @CustomerGroupId = CustomerGroupId from T_CustGroupMember
 where CustomerGuid = @CustomerGuid
 set @CustomerGroupId=isnull(@CustomerGroupId,0)
 insert into @TempTable
 select MaxPrice,MinPrice,[Percent] from VC_T_StrategyOperateCustGroup
 where CustomerGroupId = @CustomerGroupId 
 and StrategyOperateId=@StrategyOperateId

return

end

调用方式

SELECT * FROM [GetOperateCustGroup] ('12','22')

 

posted on 2013-06-18 09:37  Spider024  阅读(359)  评论(0编辑  收藏  举报