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)
 passing IN clause parameter to a Stored Procedure

Author  Topic 

Mark Fletcher
Starting Member

2 Posts

Posted - 2001-10-11 : 07:37:02
I've got a stored procedure as below


CREATE PROCEDURE test2
@pub_id varchar(1000)
AS


select * from publishers where pub_id in ( @pub_id)



If you run this sp with

exec test2 'TH01-S2001-3'

It returns rows

If you run it with

exec test2 'LD01-S2001-1'

It also returns rows

Now if you run like this

exec test2 "'TH01-S2001-3', 'LD01-S2001-1'"

It doesn't...!? Does anyone know why?

Thanks in advance! Mark

I'm using SQLServer 7 sp 6 - Using query analyser to exec this sp.



   

- Advertisement -