• Here is just another way to do the query...  I'm also someone with a heavy Oracle background that has been working with SQL.

    I ran it through the execution plan and it seems to run pretty efficiently.  Since the only thing that was really wanted out of the query was the records that didn't exist in the ratsiiafeedtransation table, this would also work.

    select IIATransactionId

    from iiafeedtransaction

    where not exists (select * from ratsiiafeedtransaction

                      where IIATransactionId = substring(rats_filename,1+patindex('%{________-____-____-____-____________}%',rats_filename),36))

    ORDER BY IIATransactionId

    The reason for adding the where clause to the subquery is so that the subquery only scans for what is needed instead of a full table scan.  If this table had an index on the field being queried it would be even more efficient.