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
 Transact-SQL (2000)
 Using using multiple values in a parameter

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-08-15 : 12:09:32
Don writes "I am trying to create a stored procedure that uses a paramter with multiple values. The parameter is then used in a selet statement. The data I am passing into the parameter is a string type. I then want to use that parameter with a "IN" clause. What is the best way to go about doing this? It looks like I need to send an array of data as the parameter . I get lost after that. I tried building a string separated with commas, but that did not work. I have searched books online and your site but found nothing so far.

Example of sp...

psp_GetClassIDs
@ClassIDs varchar(1000)

select Rights from ClassIDs where ClassID in(@ClassIDs)

Thanks in advance.

Don"

Srinika
Master Smack Fu Yak Hacker

1378 Posts

Posted - 2006-08-15 : 12:24:28
Check This :

http://vyaskn.tripod.com/passing_arrays_to_stored_procedures.htm

Srinika
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-08-16 : 12:34:53

http://www.sommarskog.se/arrays-in-sql.html


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -