I have a temp table (#Table_A) that stores the following data:
ID STRING_VALUE SCHEMA TABLE
5 %4567-9875% TEST TEST_TABLE
8 %15987563% TEST TEST_TABLE
11 %98675412358% TEST TEST_TABLE
56 %00032568974% TEST TEST_TABLE
I also have a stored procedure that does a loop through rows of another table (Table_B) for a key value. This is the syntax for executing the SP if hard coded:
EXEC @Rows = [TEST].[FindStringInTable] '%00032568974%', 'TEST', 'TEST_TABLE'
if @Rows = 1 return 56
Is there a way, that I can get the stored procedure to use multiple values from STRING_VALUE column of #Table_A and use them to determine if a match in table_B, and return the corresponding ID of #Table_A.
Below is the snipet of the flow. Blue arrows showing multiple values for the SP to use, and the red arrow showing what value should be returned once a match exist.