Home » Interview Q & A » Q6. What is BCP?

Q6. What is BCP?

Our Categories

Blog Stats

  • 34,479 hits

Calendar

June 2013
M T W T F S S
« May    
 12
3456789
10111213141516
17181920212223
24252627282930

Please visit SQLVERSITY.COM for more details.

BCP stands for Bulk Copy Program.

BCP 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:\BCPDemo\BCP.txt” -c -T

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

Ex 2:

bcp SQLVersityDB.dbo.BCPDemo out “C:\BCPDemo\BCP.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

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: