So you have a table with correct, validated names: dbo.MovieNames
Then you have a code that does some logic, and as part of the logic it stores "value" in %MovieName% variable?
And your goal is to ensure that the "value" is validated against dbo.MovieNames before it is stored in %MovieName%.
Did I understand you correctly? If yes, then perhaps simple SQL SELECT with WHERE would work for you?
1. Do whatever you today to obtain "value" but you might need to update the code so the "value" is in a format that is best to do a search in your DB
2. Add SQL that could look like that:
Select [MovieName]
FROM [dbo.MovieNames]
WHERE [MovieName] LIKE '%%%value%%%';
So if your "value" = The Empire Strikes Back
SQL would match <any string>The Empire Strikes Back<any string>
And SQL would return items such as:
Star Wars: Episode V - The Empire Strikes Back
Star Wars: Episode VI - The Empire Strikes Back 2
Star Wars: Episode X - The Empire Strikes Back 10
and so on..
3. Check whether variable returned by SQL is empty or not and take action based on that.
Or perhaps, check if you could use some other unique identifier instead of value, if available:
1. Instead of using movie title, use unique identifier and assign it to %SKU%
2. Do SQL select
SELECT [MovieName]
FROM [dbo.MovieNames]
WHERE [SKU] = '%SKU%';
3. Now you should have a correct movie name assigned to your variable returned by SQL
I always search for unique attributes, or go with regex as a last resort.