Last post Dec 15, 2015 02:29 PM by limno
Dec 14, 2015 02:54 AM|anupamabr|LINK
What is the best way to compare two coma delimited string in sql
Dec 14, 2015 03:56 AM|rjcalifornia|LINK
Dec 14, 2015 05:42 AM|Nan Yu|LINK
It depends on how you want to compare the two values . At least one match ,or both values should be identical . You could also refer to links below for same topic :
Dec 14, 2015 06:33 AM|anupamabr|LINK
Thanks for helping
My requirement is I have two tables table1, table2
Table 1 has column with coma separated value say ('1,2,3') and I am using this field as foreign key to
table-2 with split say
If the user inputs (5,3,2) then I need to delete 1 from the first and second table and add 5 to first and second table
Dec 15, 2015 01:44 AM|Nan Yu|LINK
Then you need to split the comma separated string and loop it's values :
How to split a comma separated string and loop it's values in SQL Server .
Hope it helps.
Dec 15, 2015 02:29 PM|limno|LINK
You need to redesign your table to make the foreign key relation in a one to one or one to many relationship. When you dealing with the comma separated list, you need a SPLIT function to handle individual value.