• I suspect that you don't need that UNION ALL.  Indeed, you might not need to stage in @TempTable at all.  If you post table DDL (CREATE TABLE statements) and sample data (INSERT statements), I'll show you how.  Not everybody is comfortable opening Excel files from untrusted sources.

    John