SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 SSIS Bulk Import
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

gabivas
Starting Member

10 Posts

Posted - 05/13/2014 :  13:07:15  Show Profile  Reply with Quote
Hello everyone - I was wondering if I can get some feedback regarding a project.

Basically, we will need to bulk load data every night - few throusands records, no space or any other delimiter in the file. Data comes as a test file. We have a definition table wich specifies the start, lenght of each field that we need.

So no problem here - I can generate the format file using bcp and the table with definitions.

The issue I have is when inserting this data into a final table - each chunk of data must have an ID; I cannot find a way to link the data content with the correct ID to insert into a final table.

Maybe an example will help.

My definition table:

VarID Name Desc Start Lenght
1 AdmitDate Admit Date 110 6

In the file, the Admit Date will be somewhere like this:

xxxxxx01012014xxxxx - where xxx may be some other data.

So I am able to extract the data under a staging table using bcp in this format:

AdmitDate
01012014

But I will need to insert into production using this format

RecordID VarID VarDesc VarValue
AutoGen 1 AdmitDate 01012014



How can I do that?

Thank you for your advice.

AV
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000