Wouldnt you just make a new stored proc like this?Create Procedure dbo.NewProcName (@param1 bit = null, param2 varchar(10) = null )AS BEGINif @param2 is null set @param2 = ''select field1, field2 from table1where (@param1 is null OR field3 = @param1)selectfield1, field2, field3, ...from table1...wherefield7 = 'somevalue'AND (field5 like @param2 + '%')END
Am I missing something?This is still meant to give you 2 outputs. If you are looking to combine the 2 queries into 1 result set, it may help to better understand the fields being selected and their criteria.Thanks!