bcp utility

Bcp Utility is a command-line tool for Microsoft SQL Server that can be used to export and import data.

What is Bcp Utility?

A command-line tool for Microsoft SQL Server that can be used to export and import data between SQL Server and other database servers or files. The format of the foreign data source is specified by the administrator. The bcp (“bulk copy program”) utility is typically used for such purposes as:

  • Transferring data between mainframe databases and SQL Server
  • Transferring large quantities of data to or from computers running SQL Server
  • Importing or exporting data in ASCII format

How it works

The bcp utility uses a two-step process for transferring data—the data is transferred first to a file, and then to the server. The different transfer modes available to the bcp utility include

  • Native mode:
    Used for transferring data between computers running SQL Server

     

  • Character mode:
    Generates tab-delimited text files for importing into spreadsheets or other database management systems

     

  • Format file:
    Used to transfer specific columns of data

     

TIP

An advantage of using the bcp utility is the capability of using it in a batch file for automating transfer of data between different platforms