If you are using CF to pass in your list, you can use CFQUERYPARAM's
LIST attribute.
Otherwise, you need to have single quotes around each element such as:
('1','2','3')
M!ke
-----Original Message-----
From: Rich Kroll [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 06, 2005 12:39 PM
To: CF-Talk
Subject: SQL Passed Varchar list
Hey all,
This seems really simple but I'm a bit stuck and was hoping someone
could help. I've got a SQL UDF in MSSQL that has a variable @list that
is declared as nvarchar(100), and I want to be able to pass a value list
to it (eg. 1,2,3). I'm using this in my where clause in my query (eg.
WHERE ID IN (@list)). My problem is that since it's treating the list
of integers as a string I get errors in the query. If I manually set ID
IN (1,2,3) the query works as expected, but not as ('1,2,3'). Is there
a valuelist type function in SQL to convert this? Or is there perhaps a
regex type solution?
Thanks,
Rich
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:226248
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54