Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2001-09-13 : 08:19:56
|
| Derek writes "I have a query that I want to put into a stored proc, but to do this it has to be dynamic.I will be passing it 1 variable from a web page, (let's call it @param1)Basically, here are the three queries I wan to tie into 1 by using CASE, based on the value of @param11) if @param1 = 1SELECT atable.afield FROM atableWHERE anotherfield = 12) if @param1 = 0SELECT atable.afield FROM atableWHERE anotherfield = 03) if @param1='all'SELECT atable.afield FROM atable**no where clause at all**Thanks for any help or insight. Your site has already saved me more times than I care to count. Great job!" |
|
|
|
|
|