I have a situation where server side function (c#) should return different selects from different tables (t1,t2, …) database but number and type of params are always the same.
There is a param @Type which determine a type of select should be returned.
Is it better to write a different stored procedure for each @type or write one stored procedure with switch(@type) in it ?
edit:
each select may be large about 2000 – 3000 characters
If the only commonality between the stored procedure is the definition of the parameters, I can’t see any reason to have them as one stored procedure.
One of the principles of software design is the Single Responsibility Principle – you should aim to apply that general intention to your stored procedures