1 1.存储过程 2 3 ------------------------------------ 4 --用途:[综合查询]多条件查询/GBC查询 5 --时间:2011-2-14 8:18:31 6 --名称:dangqinghua 7 ------------------------------------ 8 ALTER PROC [dbo].[DKI_GeneralSearch] 9 @SqlWhere NVARCHAR(4000)='', 10 @CMD varchar(20)='' 11 AS 12 declare @sqlStr varchar(4000) 13 declare @sqlStr2 varchar(4000) 14 set @sqlStr = 'select * from Customer where 1=1' 15 set @sqlStr2='select * from gbclist where 1=1' 16 begin 17 if(@CMD='GeneralSearch') 18 begin 19 if @SqlWhere is not null 20 set @sqlStr 21 exec(@sqlStr) 22 end 23 else if (@CMD='gbclist') 24 begin 25 if @SqlWhere is not null 26 set @sqlStr2 27 exec(@sqlStr2) 28 end 29 end 30 31 收藏于 2011-03-09