Advertisement

08.27.2007 at 02:52AM PDT, ID: 22788676
[x]
Attachment Details

Importing a text file using SQL Server/DTS with fixed width data that spans 7 lines

Asked by kgibson88 in MS SQL DTS, MS SQL Server

Tags: file, sql, text, dts, server

I am working on a DTS package that imports a text file daily.  The text file that has to be imported is fixed width, however, each record in the file spans 7 lines.  Each line of data has a line feed, or carriage return at the end, and I'm not really sure if each record has a record delimiter (Each record seems to be separated by a Line Feed or carriage return as well).  Every record begins with an account number that begins with the same prefix (M000), so I could search for that Prefix to find the begining of the record, but I don't know how to get around the carriage returns embedded in the record.  I just know that every 7th line begins a new record with a standardized prefix for the account number.  I was going to try to parse the file, and maybe use substring function in sql to insert the records and fields into their appropriate tables, or maybe try bulk insert.  I could use VB script, although that's not my strong suit.  HELP!!Start Free Trial
 
 
[+][-]08.27.2007 at 06:40AM PDT, ID: 19775358

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.27.2007 at 06:40AM PDT, ID: 19775360

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: MS SQL DTS, MS SQL Server
Tags: file, sql, text, dts, server
Sign Up Now!
Solution Provided By: Zberteoc
Participating Experts: 2
Solution Grade: A
 
 
[+][-]08.27.2007 at 06:42AM PDT, ID: 19775372

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.27.2007 at 01:08PM PDT, ID: 19778254

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_1_20070628