Flat file loading with different conditions

  • Hi All,

    I am having a flat file , format is like this :

    Start of fields :

    id

    name

    end of fileds.

    start_of_data

    1,mumbai

    2,xyz

    3,few

    end_of_data.

    Total number of records.

    So i want to load this file in to db.

    1> How can i load all the data between start_of_data and end_of_data.?

    2>how can i remove rows after the end_of_data?

  • you can either use Script task in Data Transformation or use T-SQL.

    If using T-Sql, load data into temp table with BULK INSERT (all data in one column), then transfer data to another table (Final table) - you need to do some coding in this option.

    There is one other option in T-sql, after doing BULK INSERT, you can transfer back data from table to flat file (again BULK INSERT to flat file) , during this transfer, you can write condition to include only data you require and then from there transfer back to Final table (again with BULK INSERT).

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

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