• There can be many many solutions to what you are looking for. What i woul dsuggest is don't touch the products table and create a new

    Product-Application mapping table with product_id and application the only columns. Then have one procedure or function with application

    as parameter and inside get the join between products table and this new table with condition as:

    where application_id = @application_id

    This will ensure that you are getting only relative products to an application. This is the simplest approach you can have.

    I will be eager to see what other experts suggest in this case.