Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

loading data dynamically SSIS? Expand / Collapse
Author
Message
Posted Friday, November 15, 2013 7:37 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, April 14, 2014 3:07 PM
Points: 16, Visits: 153
Hello,
I do not know the best place for this question.
Problem: I have multiple txt files in different formats as they come from different sources. I need to load this data into a single table. Since the files are being generated from multiple sources the data needs some massaging before it is loaded. We are currently loading the data all with dynamic sql. Though this works it limits the amount of control/visibility/performance we have while processing the data. I would like to use SSIS for this, but have found this to be difficult as most tasks are expecting static meta data. I was wondering if anyone has come across this and has found a way of doing this? Just a note I have a limited C# background so I am trying to accomplish this without using script tasks. Any advise/ideas would be much appreciated.
Post #1514884
Posted Monday, November 18, 2013 8:10 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Wednesday, July 30, 2014 10:34 AM
Points: 386, Visits: 624
If you mean that the files contain the same data but the field and row terminators are different and the fields are in a different order then I would look at a routine based on BCP or Bulk Insert and format files.

You can build a table of source file names and their format files and then build a dynamic SQL script (I would suggest that you do this in a stored procedure and then call the sproc from SSIS)

If you need to do any transforms on the data, then this would be more difficult. I would probably load the data into a staging table and then clean it using a child package depending on the incoming data file type but this would really be subject to the level and complexity of the data variances.
Post #1515250
Posted Monday, November 18, 2013 9:18 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, April 14, 2014 3:07 PM
Points: 16, Visits: 153
Thank you for the reply, that is what we are currently doing. I have setup a package that calls all the stored procs that do the dynamic SQL. I was just wondering if there were any SSIS options other then this.
Post #1515278
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse