Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 comparing strings using TSQL

Author  Topic 

sparrow37
Posting Yak Master

148 Posts

Posted - 2010-11-21 : 05:32:34
Hi all:

I want to compare one comma seperated string with other comma seperated string.

string A = 1,2,3
string B = 3,4

if string a contains string b (or part of string b) then it should come inside if condition.

if condition then
do this

Regards,
Asif Hameed

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-11-21 : 05:38:50
see scenario 4 in

http://visakhm.blogspot.com/2010/01/multipurpose-apply-operator.html

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

sparrow37
Posting Yak Master

148 Posts

Posted - 2010-11-21 : 05:45:57
I want to compare values. I dont want to merge them
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-11-21 : 05:50:00
you can compare by parsing and separating values as shown in link.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -