1 / 5

BCP - Bulk Copy Program

BCP - Bulk Copy Program. Bulk copying to and from Microsoft SQL Server. BCP introduction. BCP is use for import and export of data from / to Microsoft SQL Server. BCP is a simple(?) command line tool. BCP has a lot(!) of options. BCP import. Import data from a file to SQL Server.

tamyra
Download Presentation

BCP - Bulk Copy Program

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. BCP - Bulk Copy Program Bulk copying to and from Microsoft SQL Server BCP - bulk copy program for Microsoft SQL Server

  2. BCP introduction • BCP is use for import and export of data from / to Microsoft SQL Server. • BCP is a simple(?) command line tool. • BCP has a lot(!) of options BCP - bulk copy program for Microsoft SQL Server

  3. BCP import • Import data from a file to SQL Server. • Database + tables must exist • no creation at run time BCP - bulk copy program for Microsoft SQL Server

  4. BCP import example • bcp importexport.dbo.employee in newEmployees.txt -c -t, -UNV14 -Uanders -Psecret -E • bcp bulk copy program • importexport.dbo.employee • importexort name of an existing database • dbo database owner (could we write anything else??) • employee name of an existing table (in the importexport database) • in using bcp to copy data INto the table • newEmployees.txt a text file with the new data • -c the imported file is a text (character) file • - t, field terminator is "," • -SUNV14 server name is "UNV14" • -Uanders user name is "anders" • -Psecret password is "secret" • -E don't ignore the identity columns in the input file • if not new identities are generated BCP - bulk copy program for Microsoft SQL Server

  5. BCP export example • bcp northwind.dbo.shippers out shipout.txt -c -t, -SUNV14 -Uanders -Psecret • bcp bulk copy program • northwind.dbo.shipper • northwind name of database • dbo database owner • shippers name of table • out copying OUT from the database • shipout.txt name of the receiving file • -c output is a text (character) file • - t, field terminator in output file is "," • -SUNV14 server name is "UNV14" • -Uanders username is "anders" • -Psecret password is "secret" BCP - bulk copy program for Microsoft SQL Server

More Related