I'm writing stored procedures to retrieve data from various tables for a web application. My question is kind of broad in nature.
When I want to retrieve the same data based on slightly different criteria should I write two different stored procedures, or is there a way to make it as one.
For example, my first query I want to retrieve an equipment list based only on customer ID. In the second instance, I would want to add the equipment ID along with the customer ID.
Should this be one stored procedure or two? Is there a way to write a stored procedure that knows how many parameters are passed to it?
Thank you