One issue here is that you are creating the hash table and populating it together - thus, you can be locking the sys tables which relate to table/column names for the duration of the query.
We had the same issue and the answer is to first create your hash table, and then populate it with insert...into