Avatar of Southern_Gentleman
Southern_GentlemanFlag for United States of America

asked on 

Use column to search string column

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.
Microsoft SQL Server

Avatar of undefined
Last Comment
Southern_Gentleman
ASKER CERTIFIED SOLUTION
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Southern_Gentleman

ASKER

Thanks Jim, that was a great article. It will work perfect for my scenario
Microsoft SQL Server
Microsoft SQL Server

Microsoft SQL Server is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.SQL Server is available in multiple versions, typically identified by release year, and versions are subdivided into editions to distinguish between product functionality. Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning.

171K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo