You probably need to change it to varchar(?), then you can create an sql
string.  (watch out for sql injection!)

Declare @SQL varchar(8000)
Set @SQL = '    SELECT *
                        FROM Content C INNER JOIN Links L
                                ON C.ContentID = L.ContentID
                        WHERE (C.ContentType IN (' + @contenttype + '))
                '
Execute (@SQL)


-----Original Message-----
From: Michael Dinowitz [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 10, 2005 18:55
To: SQL
Subject: Using IN clause with a stored procedure

I have a stored procedure that will have an In clause. How do I pass a
list of integers to it?

CREATE PROCEDURE GetNewsContent @contenttype int
AS
SELECT *
FROM Content C INNER JOIN Links L
        ON C.ContentID = L.ContentID
WHERE (C.ContentType IN (@contenttype)) 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:6:2344
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/6
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:6
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.6
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to