|
The bcp command line prompt utility copies Microsoft® SQL Server&# 8482; data to or from a data file. This utility is most commonly used to transfer large amounts of data from other programs (usually another database management system (DBMS)) to SQL Server tables. The data is first exported from the source program to a data file, and then bcp is used to import the data from the data file to the SQL Server table. In addition, bcp can also be used to transfer data from SQL Server tables to data files for use by other programs. For example, you can copy data from an instance of SQL Server to a data file. Other programs can import data from this data file.
Note The bcp utility is written using the ODBC Bulk Copy Application Program Interface (API). The earlier version of the bcp utility was written using the DB-Library bulk copy API.
Using the BULK INSERT statement, you can also transfer data from data files to SQL Server tables. However, the BULK INSERT statement cannot bulk copy data from the SQL Server instance to the data file. The BULK INSERT statement enables you to use Transact-SQL statements instead of the command prompt to implement the functionality of the bcp utility, and bulk copy data to SQL Server instances.
You can also use the bulk copy API to bulk copy data between SQL Server and data files by writing programs. The bulk copy API can be used in applications based on ODBC, OLE DB, SQL-DMO and DB-Library. |
|