I might be over-analyzing this but I have 13,000 records stored in a temp table that only has one column.
I'm trying to determine if those records exist in another database/table but there's no key between the two other than the one column.
The query I run has to use LIKE so something like this...
declare @string Varchar(25) = (select top 1 * from accts)
select content from db2..[mc3] where content like '%'@string+'%'
This may take a while, but you can get the matching ones using:
select a.?? from accts a where exists (select 1 from db2..mc3 where mc3.content like '%' + a.?? +'%' );
This gets accounts that are in
mc3 according to your rule.
I should note: performance will be pretty bad. Better than a cursor but that's not saying much.