We are developing an application where sometime we need to support more than one versions of that software at a time. For example Release 1-0-300 , 1-0-300-With-Test-FunctionalityA, Release 1-0-300-With-Test-FunctionalityB. Due to such requirements we sometime use the same Stored Procedure with different name in different versions for example
"1-0-300" uses Stored Procedures "USP_GetProucts"
"1-0-300-With-Test-FunctionalityA" uses Stored Procedures "USP_GetProucts_FunctionalityA"
"1-0-300-With-Test-FunctionalityB" uses Stored Procedures "USP_GetProucts_FunctionalityB"
1- Why we are not using some alternate solution like we can have a Parameter "WhichStoredProcedureToCall" based on that parameter we can call the required STored Procedure? Because "USP_GetProucts" can have total different functionality than "USP_GetProucts_FunctionalityA" & these are huge stored procedures.
2- We are using SQL2008.
So my question is can we implement some type of "Stored Procedure Redirect", if "USP_GetProucts_FunctionalityA" not found then get the results form "USP_GetProucts"
asked Jan 09, 2012 at 04:20 AM in Default
You could do that directly from your code pretty easily.
But, you could build a wrapper procedure that calls other procedures. That's a pretty standard coding methodology. It's also easy to check the row count within a proc to determine if the previous call returned anything (or even return an output parameter that says no results were forthcoming) and then call another proc.
You have choices.
answered Jan 09, 2012 at 04:41 AM
Grant Fritchey ♦♦