I have three variables that may or may not need to be passed on to a stored procedure, basically an all option and then options based by breaking it down by a few values. I have the the procedure if someone chooses the break down options and selects all the options individually but then I would have to make a GetReportbySV, GetReportbyVE, etc. Is there anyone to do this all in one stored procedure of would I be better off with 8 of them?
create proc GetReportbySVE
@SCode int,
@VCode int,
@ECode int
as
begin
select * from D
where S = @SCode and V = @VCode and E = @ECode
end
edit: I am using a C# winform to pass the data to this procedure.