Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004

    Unanswered: Import text file report with varying content and records


    I get error reports in simple text files like the one below in relatively the same format. The only thing that varies is the number error reasons as there can be any number of error reasons for a file. Usually there is only one but there can be a handful. What is the best way to capture the error description and count of errors no matter how many there are? I want to take these items and update a table I have in sql server 2008r. Thanks.


    Report Message example:
    ************************************************** *****

    Original File Name: some.file.YYYYMMDD.d.incr.02of02.1.dat
    Source File ID: file02YYYYMMDD
    File Receipt Date: 10/17/2014
    Total records received: 1331136
    Total records loaded: 1329987

    Error code: EBBW002 Error desc: Duplicate Record Total records: 1146
    Error code: EABC001 Error desc: Invalid Length Record Total records: 1
    Error code: ERRCM10 Error desc: Missing First Name Total records: 2

    Total number of Errors encountered during the ODS update processing: 1149
    ************************************************** *****

  2. #2
    Join Date
    Apr 2014
    Provided Answers: 32
    I would get an access db, click an import button
    Code would remove the top 8 lines of the file, save.
    then import the text file delim by :
    then append query to post the data to SQL svr.

  3. #3
    Join Date
    Oct 2010
    Atlanta, GA
    Provided Answers: 2
    building on what ranman26 said, you can even set up some scheduled tasks to do this automatically.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts