• I haven't tested this since there was no test data supplied, but I think this should work.

    Insert into MergeTable (Project number, IsProjNumConverted)

    Select Coalesce(x.proj_id,i.proj_id) as projID,

    Case

    When x.proj_id is not null then 1

    else 0

    End Converted

    FROM dbo.Incident_Info i

    left outer join Repository.dbo.PROJ_ID_XREF x on x.PROJ_ID=i.Proj_ID