Hello gurus, I have a question regarding a situation.
I have a query that was originally build dynamically using ASP. The ORDER BY clause can 4 different "values", based on a value in an ASP variable.
Here is my question.
What is the best way of going about putting these different scenarios of ORDER BY clauses within my SP?? Or perhaps, should I not even use a SP and possibly use a view instead?
If SP is the right way, should I make 4 different SP, one for each different ORDER BY clause or make 1 SP with each query separated within IF blocks?
If I don't have enough information for you, please let me know.
![[monkey] [monkey] [monkey]](/data/assets/smilies/monkey.gif)
<.
I have a query that was originally build dynamically using ASP. The ORDER BY clause can 4 different "values", based on a value in an ASP variable.
Here is my question.
What is the best way of going about putting these different scenarios of ORDER BY clauses within my SP?? Or perhaps, should I not even use a SP and possibly use a view instead?
If SP is the right way, should I make 4 different SP, one for each different ORDER BY clause or make 1 SP with each query separated within IF blocks?
If I don't have enough information for you, please let me know.
![[monkey] [monkey] [monkey]](/data/assets/smilies/monkey.gif)
![[snake] [snake] [snake]](/data/assets/smilies/snake.gif)