Results 1 to 5 of 5

Thread: how to load text file into single row ?

  1. #1
    Join Date
    Sep 2002
    Posts
    159

    how to load text file into single row ?

    Hi
    how to load text file into single row

    I already created dts using
    Read File Transformation to place
    data in to buffer table then
    update row in main table

    Is Any way to do it without using DTS , just with T- Sql or bcp ?

  2. #2
    Join Date
    Feb 2003
    Posts
    1,048
    Yes, which part of your process is it you need help figuring out how to run?

    BCP in data from text file into buffer table and then update the data inteh main table.

    Use xp_cmdshell to execute BCP.

    Just curious, but why the desire to eschew DTS?

  3. #3
    Join Date
    Sep 2002
    Posts
    159
    read data from file is part of stored procedure.
    If I use dts I have copy dts and procedure to production.

  4. #4
    Join Date
    Sep 2002
    Posts
    5,938
    You can load data from text file with bulk insert in query analyzer or with bcp in dos.

  5. #5
    Join Date
    Dec 2004
    Posts
    502
    Also, did you want your text file to be in a single row, or a single column as well? If you wanted it to be self-contained in a single row and column, your target table should have a column with a datatype of "text". As long as your textfile is less than 2GB in size, it should fit in there.

Posting Permissions

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