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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 dynamic IN

Author  Topic 

iamsmahd
Yak Posting Veteran

55 Posts

Posted - 2006-06-17 : 03:43:25
HI ALL....
I have an asp form that lists name of students. every student has a checkbox before its name. So, user can selects some students from the list.when the user submits the form one variable is built based on the choices and the choices separate with ",". for example ::

myVar=456789,234567,445109 --if the has selected 3 checkboxes --
now I wanna to select from table t1 records that their ID is in myVar
select * from t1 where oID IN @myvar
but it is not correct? what is the solution plz? thank you very much

PSamsig
Constraint Violating Yak Guru

384 Posts

Posted - 2006-06-17 : 08:09:51
Read this http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=25830
Found here http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=55210 (keep this one linked)

-- This one's tricky. You have to use calculus and imaginary numbers for this. You know, eleventeen, thirty-twelve and all those.
Go to Top of Page

mmarovic
Aged Yak Warrior

518 Posts

Posted - 2006-06-17 : 10:31:18
http://www.sql-server-performance.com/mm_list_random_values.asp
http://www.sommarskog.se/arrays-in-sql.html
Go to Top of Page

iamsmahd
Yak Posting Veteran

55 Posts

Posted - 2006-06-19 : 03:52:50
THANK YOU VERY MUCH

sonia
Go to Top of Page
   

- Advertisement -