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)
 Using CSV

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-09-11 : 13:59:39
venkat writes "Hi,
SQL Server Version -2000
Windows 2000/NT

I have written a stored procedure with a parameter @list which contains a values separated with commas.
for example @list = '1','2','3'.but i am not able to get the anticipated results even though there are values('1','2','3') for Num_Center in center table.

Below is the script used.

CREATE PROCEDURE CenterInfo
@list VARCHAR(1000)
AS
SELECT * from Center WHERE Num_Center IN (@list )
GO

Thanks in advance,
Venkat"

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2002-09-11 : 14:02:25
You can't use a variable as an arguement to an IN construct.

Read up on csv ....

Jay White
{0}
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-09-11 : 14:48:37
You should also read the FAQ:

http://www.sqlteam.com/FAQ.asp

It answers your question.

Go to Top of Page
   

- Advertisement -