Need help with Bulk Insert ASAP

  • I must confess I've never used bulk insert that much, I still favor bcp for my loads and unloads.

    In the simples way, using bcp, the command would look something like:

    bcp hospital.dbo.patbill in h:\patbill_200503.txt -F2 -c -t"|" -r\n -T

    The above runs when H: is local to the server and uses trusted connection.

    You would perhaps want to add switches for error and output files, codepage, servername, userid and password if needed.

    Last note when using pipe as delimeter - it's important to denote the pipe with doublequotes, or you risk it beeing seen as a redirection command instead.

    /Kenneth

     

  • Not sure what your conditions are for the import but I would change the recovery model of your DB to BulkLogged First, then perform the Import and finally change the Recovery back to Full

    Cheers,

     


    * Noel

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

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