Help with stored procedure

Help me?

So, you need help. I don't know what your question is so let's start with the beginning.

sp = stored procedure

There is a great tutorial on youtube. 9 years old but still very clear:

Then you have 2 input parameters en you must output the list you have provided.

You have several options in the WHERE clausule so you can just put it there, something like this example.

T-SQL: Using CASE Statement in WHERE Clause (Multiple conditions) (microsoft.com)

JSON is very easy to use and to create, there is some great documentation here:

Work with JSON data - SQL Server | Microsoft Docs

Just read the documentation, try to create an sp first, create the imput parameters later, try 1 condition in the where clausule, try 2 conditions in the where clausule etc.

If you provide a working example with data and what you have created so far, I can help you getting to the next step.