A Kittke help needed

  • I am trying to import part of the following file structure into a SQL2005 table

    The 1st 10 records are not needed (HEADER DATA), neither are the records that are from ‘TRAILER RECORD’

    Can anyone assist me in designing a Simple SSIS to import this file to a table

    The LedgerKey will be from a Global variable

    Text within <> are for information and NOT contained in the file

    In this file there are three records to import, however i need to be able to handle upwards of 20,000 records

    Table

    CREATE TABLE [dbo].[TempTransactions](

    [LedgerKey] [varchar](20) NOT NULL,

    [Licence] [varchar](6) NOT NULL,

    [DestSortCode] [varchar](6) NOT NULL,

    [DestAccountNumber] [varchar](8) NOT NULL,

    [DestAccountName] [varchar](18) NULL,

    [TransValue] [varchar](11) NOT NULL,

    [DestBankRef] [varchar](18) NULL,

    [TransCode] [varchar](2) NOT NULL,

    [tranref] [int] IDENTITY(1,1) NOT NULL

    ) ON [PRIMARY]

    File

    < HEADER DATA NOT REQUIRED >

    "Header Data"

    "Header Data"

    "Header Data"

    "Header Data"

    "Header Data"

    "Header Data"

    "Header Data"

    "Header Data"

    "Header Data"

    "Header Data"

    < HEADER DATA NOT REQUIRED >

    "11111122222222TEST ACCOUNT 1 BANK REG 0000000020017"

    "33333344444444TEST ACCOUNT 2 BANK REG 0000000150017"

    "55555566666666TEST ACCOUNT 3 BANK REG 0000000030017"

    "TRAILER RECORD"

    "TRAILER RECORD"

    "TRAILER RECORD"

    "TRAILER RECORD"

    "TRAILER RECORD"

    "TRAILER RECORD"

    "TRAILER RECORD"

    "TRAILER RECORD"

    "TRAILER RECORD"

    "TRAILER RECORD"

    "TRAILER RECORD"

    "TRAILER RECORD"

    "TRAILER RECORD"

    "TRAILER RECORD"

    Any help much appricated

  • you can use xslt to transform your file into xml if you have fixed width columns. I use a front end app to do this. you can then import the file into sql

    or you can preformat your file by deleting the unneeded header records and trailer, then using a defined format file you can then use the import wizard.

     


    Everything you can imagine is real.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply