copying data WITHOUT DTS

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • David Greenberg

    copying data WITHOUT DTS

    Hi
    We use Sql Server 2000.
    Is there a way to copy and entire text file into a database table
    without using a DTS ?
  • Tom van Stiphout

    #2
    Re: copying data WITHOUT DTS

    On Mon, 10 Mar 2008 11:07:05 +0200, David Greenberg
    <davidgr@iba.or g.ilwrote:

    Yes. For example you can use BCP (=Bulk Copy Program). Find it in
    Books Online.

    -Tom.

    >Hi
    >We use Sql Server 2000.
    >Is there a way to copy and entire text file into a database table
    >without using a DTS ?

    Comment

    • Plamen Ratchev

      #3
      Re: copying data WITHOUT DTS

      In addition to BCP you can use a BULK INSERT statement (example below for
      comma delimited file):

      BULK INSERT MyTable
      FROM 'C:\Test.txt'
      WITH
      (
      FIELDTERMINATOR = ',',
      ROWTERMINATOR = '\n'
      )

      For more complex file formats you can use a format file.

      HTH,

      Plamen Ratchev


      Comment

      Working...