Archive for September, 2008
Problem with Sql Parameter which uses IN Keyword with single quote in @parameter
by chintan prajapati on Sep.08, 2008, under ASP.net
it took plenty of time for me to search below article in google.. may be i didn’t get proper keywords to search solution.
http://bytes.com/forum/thread257290.html
here’s solution .. which u can find in above article
DECLARE @codes NVARCHAR(100)
SET @codes = ‘G01,G02′
SELECT * FROM tbRules
WHERE CHARINDEX(rule_code, @codes) > 0
returns the same result set as
SELECT * FROM tbRules
WHERE rule_code IN (’G01′, ‘G02′)
actually above trick is helpful when implementing
lucene search
tags: Sql Server, IN keyword Problem,single quote, “‘”,Lucene.net