Some background info to begin.
First, I have 28 fixed width text files. From there, I import them using bulk insert into one of 6 larger tables. The reason for the delineation is that each set has to be treated differently with respect to one of the primary key fields, indcode. Initially, all of the indcode values have 6 digits and from there, I selectively trim that down. 102800 becomes 1028, 111330 becomes 11133 and so on.
From there, I have 2digit, 3digit, super, 5digit, 6digit, and industrytotals. Next, I merge those 6 into one final table, industry. Initially, there 33040 rows between the six. When I run the merge statement, the end result is 32735. When I put it in excel and concatenate across all 22 columns and then remove duplicates, I get 32339.
Below is the merge statement that I use.
merge industryimport as t
using (
...