Zoom Asp.net

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

Leave a Comment more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...

Failed creating file mapping PHP Fatal error: Failed creating file mapping in Unknown on line 0 PHP Fatal error: XCache: Cannot create shm in Unknown on line 0