imprt text file to DB

  • hello guys

    i want to import a big text file with a fixed record length(288) to tables.i need to read a record and check it then call a store procedure for convert some fields to import 1 table for some condition and if that condition not true import in another table.i do not want to use ssis package.please help me thnks

  • Hi,

    You can do it with ssis easily, but its your choice.

    If I were you I would first make a bulk insert into a temporary table. That is easy and fast. See this for bulk insert http://msdn.microsoft.com/en-us/library/ms188365.aspx

    Then I'll make some set-based statements, but no cursors or loops, because your table is big.

    Insert into Import1_table(col1,col2, ..., colN)

    From bulk_table bt

    Where your_check_conditions_for_import1

    insert into import2_table(col1,col2, ..., colN)

    From bulk_table bt

    Where your_check_conditions_for_import2

    Regards,

    IgorMi

    Igor Micev,My blog: www.igormicev.com

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

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