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)
 How to pass a CSV into a stored procedure?

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-05-13 : 11:17:18
Matt writes "I am trying to pass a CSV containing primary key ids. I want to delete from a table all records having a primary key not contained in the CSV. SQL Server 7 is attempting to convert the csv into an integer and is crashing.


MY CODE:

CREATE PROCEDURE DeleteRecord(@ListCSV varChar(3000)) as

DELETE Table1 FROM Table1
WHERE Table1.primarykeyid NOT IN (@ListCSV)

ERROR MSG:
Syntax error converting the varchar value '369, 164' to a column of data type int."

graz
Chief SQLTeam Crack Dealer

4149 Posts

Posted - 2002-05-13 : 11:17:18
Please read the FAQ (http://www.sqlteam.com/FAQ.asp). There are some links there that might help.
Go to Top of Page
   

- Advertisement -