importing txt files to sql tables

  • importing txt files to sql tables

    1.everyday filename will change

    for example sample file name ----

    nn_10202008001

    tt_10202008001

    2. everyday there will be one set or two or may be many set for import

    for example sample file names ----

    nn_10202008001

    tt_10202008001

    nn_10202008002

    tt_10202008002

    3. import nn_ file/s to newnote table & tt_file/s to transfertake table.

    4. How to achieve this is SQL 2000 DTS

    thanks

  • Hi,

    The only way I see in SQL Server 2000 is to write an activex script. I dont have the code to paste it here, as I have worked a long back on this. First is you need to make sure all files are posted in one directory.

    Second write an activex to store the name of files in one txt file. Third read the file name from this txt file, as and when you read the filename, after completion delete the line from the text file. Trust me, this method will work. This also needs you to be aware of write a windows batch file. Its a little tidious job, but a combination of Batchfile, Activex sripts.

    Regards,

    Rajesh

  • hmmmm

    is there any otherway?

  • Yeah... but do you need to use DTS or SSIS or is doing it all in T-SQL without the use of xp_CmdShell ok?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 4 posts - 1 through 3 (of 3 total)

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