Results 1 to 2 of 2

Thread: Loading data into SQL 2000 from text files

  1. #1
    Melanie Guest

    Loading data into SQL 2000 from text files

    I have 6000+ text files, average size 400 kb, that I need to load into 1 table in Sql Server 2000. Does anyone know of an easy way to do this? I thought I would just write a little VB app to loop through all the files in the directory and insert the data into an existing table but there must be an easier way.

    Any help would be appreciated.


  2. #2
    David King Guest

    Loading data into SQL 2000 from text files (reply)


    If they are all the same format, then you could write a SQL batch using the bulk insert command.

    Get a directory listing to a temp table, and then loop through, bulk inserting each one as you go. You would need to use the exec command as the bulk insert cannot take variables.

    David

    ------------
    Melanie at 5/1/2002 12:36:04 PM

    I have 6000+ text files, average size 400 kb, that I need to load into 1 table in Sql Server 2000. Does anyone know of an easy way to do this? I thought I would just write a little VB app to loop through all the files in the directory and insert the data into an existing table but there must be an easier way.

    Any help would be appreciated.


Posting Permissions

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