If I understand correctly you can use a stored procedure and if the parameter you pass it is Null, then it will still run the stored procedure. See below:
ALTER PROCEDURE [dbo].[spYourStoredProcedure]
-- Add the parameters for the stored procedure here
@Parameter VARCHAR(15) = NULL
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
--SELECT <@Param1, sysname, @p1>, <@Param2, sysname, @p2>
END
The above line of code will be a value of NULL if nothing is passed to the stored procedure. If the Parameter value is NULL, then you check for that before you decide which query to run.