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-07-26 : 09:53:49
|
| Aaron writes "Sorry, I had a mistake in my query that I submitted to your guys a little bit ago which might have caused some confusion -- here is my revised question :..................I have wasted way too many hours trying to figure this one outso I thought I'd throw it out there for the real experts.Here is my question : How do you pass the arguments for a SQL"in" clause as a parameter?For instance, I have the following stored procedure :CREATE PROCEDURE usp_FindMyState@pState varchar(250)ASSELECT *FROM statetableWHERE state IN (@pState);and I have a comma separated list of states (generated originallyfrom an HTML multiple listbox) that I want to pass in to the storedproc. However, I am unable to get this to work using any of the following combinations :usp_FindMyState "CA,CO"usp_FindMyState "'CA','CO'"... even ...usp_FindMyState 'CA"... does not work ...However, if I manually type in the exact code, it works fine such as :SELECT *FROM statetableWHERE state IN ('CA','CO');Oh, the agony. Help anyone?" |
|
|
|
|
|