What is Bulk Copy Program (BCP)?

BCP

BCP stands for Bulk Copy Program.

It is used to Import/Export the data between Data files and SQL Server. BCP Commands are case sensitive.

Syntax:

bcp <Table/View/Query> <in/out/queryout/format> <File Name> <options>

Ex 1:

bcp SQLVersityDB.dbo.BCPDemo in “C:\BCPDemoBCP.txt” -c -T

It imports all the records of BCP.txt into BCPDemo table.

Ex 2:

bcp SQLVersityDB.dbo.BCPDemo out “C:\BCPDemoBCP.txt” -c -T

It exports all the records of BCPDemo table into BCP.txt.

-c indicates data is character type

-T indicates trusted connection. It tells that BCP should use windows authentication to connect to database.

Note:

To see the description of all BCP command line arguments, Start — type CMD and press Enter — Type BCP and press enter.

For more information about BCP, Click here

Leave a Reply

Your email address will not be published. Required fields are marked *