bcp Vs Bulk Insert

Posted on 2006-04-26
Last Modified: 2008-01-09
What is the difference between bcp(Bulk Copy Program) and Bulk Insert in MS-SQL?
Question by:sti2006

    Author Comment

    Not Yet Found Any Answer
    LVL 75

    Accepted Solution

    Hi sti2006,

    1.BCP : is a command prompt utility
    2.  BULK INSERT statement cannot bulk copy data from an instance of SQL Server to a data file.

    LVL 75

    Expert Comment

    by:Aneesh Retnakaran
    BULK INSERT is “in memory”
    BCP is more configurable
    Both are single threaded
    Only run on one CPU( No parallel operations)
    LVL 11

    Assisted Solution

    by:Ved Prakash Agrawal
    BCP used to transfer the data into data file with complete table or you can use query to be data transfer from table to file.
    file may be text file or CSV and also you can give the formatting also.

    BULK insert used to copy data from files to database tables.

    LVL 4

    Expert Comment


    Using ODBC BCP API in 7.0 and 2000
    Native format is most optimal
    Less parsing efforts/cost
    No string to data type conversions!
    Use load hints:
    Import & Export
    Local or Remote
    Always uses Net Library
    Version switch for down level native and char formats

    Bulk Insert

    “Fastest” way to load data into SQL Server
    Everything is in-process with SQL Server
    If table has existing data and is a HEAP, BULK INSERT starts on new extent to provide lightweight ROLLBACK
    Ordered input data
    Bulk Insert uses 1 Thread per CPU
    Connections affinities to a UMS scheduler
    Import only
    Server based
    Streams rowset directly in to server
    No support for down level version input (native) data formats (no -V)

    Chetan Sachdeva
    LVL 42

    Expert Comment


    Using bcp and BULK INSERT

    the BULK INSERT statement cannot bulk copy data from an instance of SQL Server to a data file. The BULK INSERT statement allows you to bulk copy data to an instance of SQL Server using the functionality of the bcp utility with a Transact-SQL statement, rather than from the command prompt.

    check the article
    SQL Server 2005 Books Online  
    Introducing bcp, BULK INSERT, and OPENROWSET(BULK)

    Copies a data file into a database table or view in a user-specified format.

    The BULK INSERT statement can be executed within a user-defined transaction. Rolling back a user-defined transaction that uses a BULK INSERT statement and BATCHSIZE clause to load data into a table or view using multiple batches rolls back all batches sent to SQL Server.

    Only members of the sysadmin and bulkadmin fixed server roles can execute BULK INSERT.

    LVL 11

    Expert Comment

    by:Ved Prakash Agrawal
    BCP use for Creating data file into file system

    BULK INSERT use for importing data from data file which is in file system

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    This is my first ever Article on EE or elsewhere; therefore, please bear with me if I have some discrepancies in my writing. I read many articles and questions related to "how to pass values to SSIS packages at run-time?"  Hence, this common ques…
    This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
    Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
    Viewers will learn how the fundamental information of how to create a table.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now