Imagine we have the following parameters to do a search passed into a SPROC:
Now, I need to do a search on these parameters where values are supplied. I know we can use a dynamic SQL concat and execute it in the SPROC but maybe messy and not optimised.
For instance, they may pass in ALL parameters therefore I have to do a search on all the tables or fields.
But if they pass in just Manufacturer AND type or maybe they pass in model AND manufacturer.... (and so on).... different queries are needing to be executed.
Question is, what is the best way of creating a SPROC to handle this with different combinations and not having to use dynamic SQL?