HOw to search particular word in long string [Resolved]

Posted by Pkanwar under Sql Server on 5/8/2013 | Points: 10 | Views : 1512 | Status : [Member] | Replies : 5
Hi

I want to write a query for searching particular text in long string:
Like: column 1 have data : This is Dotnetfunda in DotNet
Collumn 2 have data: This is dotnetfunda in dotnet. It is good.
Now when I enter Dotnetfunda in text box the all result will be show: This is Dotnetfunda in DotNet.
And when we enter dotnetfunda the result will be shown: This is dotnetfunda in dotnet. It is good.
Any Idea for such type of query:



Thanks




Responses

Posted by: Learningtorise on: 5/8/2013 [Member] Starter | Points: 50

Up
0
Down

Resolved
You want your result to be case sensitive but then it depend on column collation.


You should change column collation to case sensetive, like SQL_Latin1_General_CP1_CS_AS (hint: CS means "case sensetive", CI - insensetive).


http://hashtagakash.wordpress.com/

Pkanwar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Pandians on: 5/9/2013 [Member] [MVP] Silver | Points: 25

Up
0
Down
Yeah. I'm agree with "Learningtorise"

You can go with Statement Level collation
SELECT * FROM TableName

WHERE Column1 LIKE '%Dotnetfunda%' COLLATE SQL_Latin1_General_CP1_CS_AS
GO


Cheers
www.SQLServerbuddy.blogspot.com
iLink Multitech Solutions

Pkanwar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Pkanwar on: 5/9/2013 [Member] Starter | Points: 25

Up
0
Down
Thanks for this great solution.............

Pkanwar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Learningtorise on: 5/9/2013 [Member] Starter | Points: 25

Up
0
Down
If you found your answer then please click on "Mark As Answer"

http://hashtagakash.wordpress.com/

Pkanwar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Annaharris on: 5/9/2013 [Member] Starter | Points: 25

Up
0
Down
Pandians is absolutely right, thanks for sharing the query.

Pkanwar, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response