I am trying to iterate over a long string that I will pass to a stored procedure in SQL Server that will contain "State" plus "Id" separated by comma - like so
string = "NH!01,MA!02,VA!04"
My question is, how can I select items from a table that has 3 columns state, id and descr, based on that list of valises on the string above?
select *
from tablename
where state = first item[0] in the list
and id = first item[1] in the list
and so on.
Please feel free to suggest better implementation for this.