Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

Using CTE with Bulk Insert

$
0
0

This is a bit convoluted so bear with me. This new project is one where I get 36 fixed width flat files and then import them (using bulk insert)  in a specified fashion. They get allocated into one of 7 separate tables and then manipulated on a table by table basis. 

This is done on a quarterly basis. At present, each of the 7 tables (supern, 2digit, 3digit, 5 digit, 6 digit, rollup1, and rollup2) are created each and every quarter. The current convention is to create supern1 then supern 2, and so on. Once the import into each is done and the necessary case by case manipulations of the data are done, they are essentially merged together. 

My question is whether I can use CTE to avoid creating the 7 component tables each and every quarter? If so, would it be overly complex. 


Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>