Bulk Import and export data--bcp utility
Role
The bcp utility can bulk copy data between a SQL Server instance and a data file in a user-specified format .
You can use the bcp utility to import a large number of new rows into a SQL Server table, or to export table data to a data file.
Unless used with the queryout option, you do not need to know the Transact-SQL knowledge to use the utility.
To import data into a table, you must use a format file created for the table, or you must understand the structure of the table and the data types that are valid for the columns in the table.
Attention:
If you use bcp to back up your data, create a format file to record the data format. BCP data files do not include any schema or format information, so if you have deleted a table or view and you do not have a format file, you may not be able to import data.
Experience talk
The data format used for bulk import or export directly affects the accuracy of importing or exporting data. BCP uses the character format-c parameter to import or export data, allowing it to automatically transform for simple data retrieval. But in fact, many data types will be truncated, garbled and so on after the conversion. Creating a format file is the best way to guarantee the accuracy of exporting or importing data. Of course, if you understand the structure and data type of a table, you can choose the appropriate application scenario between native (database) format, character format, Unicode native format, Unicode character formatting, and enter the correct parameters.
Reference:
Https://msdn.microsoft.com/zh-cn/library/ms162802.aspx
This article is from the SQL Server deep dives blog, so be sure to keep this source http://ultrasql.blog.51cto.com/9591438/1628038
Bulk Import and export data--bcp utility