Write a stored Procedure that takes the filter query dynamically according to cases
Create procedure GetPoi (@Name nvarchar (100),@Version nvarchar (100))
as
begin
declare @Command nvarchar(max)
set @Command = 'select * from tablename where name ='''+@Name+''' and Version='''+@Version+''''
exec sp_executeSql @Command
end
Also you have to make a test to check if the Parameters provided are empty strings and modify your where clause accordingly. Check Dynamic SQL for more info