We help IT Professionals succeed at work.

Use column to search string column

90 Views
Last Modified: 2017-03-23
I'm doing a small audit on our data and
I want to take a column that has a long string that separates product models with a comma and see if any of those models are not valid from  separate table column. This validation is based on the model column of the manufacturer table.

So the manufacturer table has the following data:
Model    |   manufacurerid  | manufacturername
xxx1       |         1                     |  delta
xxx2       |         1                     | delta
xxx3       |         3                     |  alpha
xxx4       |         2                     |  beta
xxx5       |         1                     | delta
xxx6       |         3                     |  alpha


The manufacturerenrollment table has the following data:

ManufacturerID  |  Model
1                            |   xxx1, xxx2, xxx4, xxx5
3                            |  xxx3, xxx6

- So i want to find out what model and manufacturer from the manufacturer table does match in the model column of the manufacturerenrollment table.

So the results would be the following because the xxx4 belongs to manufacturer 2 and not 1:
model   | manufactuerid   |   manufacturer
xxx4       |       2                    | beta

I would prefer not to use the contains function only for the mere fact that i don't have the rights to do a full-text index in the manufacturerenrollment table.
Comment
Watch Question

SQL Server Data Dude
CERTIFIED EXPERT
Most Valuable Expert 2013
Author of the Year 2015
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION

Author

Commented:
Thanks Jim, that was a great article. It will work perfect for my scenario

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions