BCP Example (SQL Server)

BCP is the bulk copy utility for MSSQL. It is a good tool for making backups of tables before running an update query.:

bcp myDB..myTable out myOutputFile.sql -U myUser -P myPassword -S myServer -c -q

or, to use a trusted connection:

bcp myDB..myTable out myOutputFile.sql -T -S myServer -c -q

Note the double periods between the db name and the table. I don't know why it's there, but it's necessary.

Tags: mssql, query, backup, export, import, bcp, bulk, copy, records, sql server, fast


 

Related Scribbles:
  • SQL Server
  • Backup Tricks and Links


  • ID: 655
    Author:
    leonard
    Date Updated:
    2014-08-05 14:26:46
    Date Created:
    2005-07-07 09:53:46

    Edit

    Comments?
     >> Leonard Chan's Homepage  >> Scribble Web  >> BCP Example (SQL Server)
    leonard.lotus-land.ca is hosted by Perceptus Solutions Inc.