The bcp Command-Line Utility

You use the bcp (bulk copy program) tool to address the bulk movement of data. This utility is bidirectional, allowing for the movement of data into and out of a SQL Server database.

bcp uses the following syntax:

bcp [database_name.] schema.{table_name | view_name | "query" {in
data_file | out data_file | queryout data_file | format nul}
[-a packet_size] [-b batch_size] [-c]
[-C { ACP | OEM | RAW | code_page } ]
[-d database_name] [-e err_file] [-E]
[-f format_file] [-F first_row] [-h"hint [,...n]"]
[-i input_file] [-k] [-K application_intent]
[-L last_row] [-m max_errors] [-n]
[-N] [-o output_file]
[-P password] [-q] [-r row_term]
[-R] [-S [server_name[\instance_name]]
[-t field_term] [-T] [-U login_id]
[-v] [-V (80 | 90 | 100 )] [-w]
[-x]
/?

Some of the commonly used options—other than the ones used to specify the database, such as user ID, password, and so on—are the –F and –L options. These options allow you to specify the first and last row of data to be loaded from a file, which is especially helpful in large batches. The –t option allows you to specify the field terminator that separates data elements in an ASCII file. The –E option allows you to import data into SQL Server fields that are defined with identity properties.


Tip

The BULK INSERT T-SQL statement and SSIS are good alternatives to bcp. The BULK INSERT statement is limited to loading data into SQL Server, but it is an extremely fast tool for loading data. SSIS is a sophisticated GUI that allows for both data import and data export, and it has capabilities that go well beyond bcp.


BCP command usage in SQL Server的更多相关文章

  1. BCP 导出导入数据(SQL Server)

    BCP指令工具可通过安装SQL Server获得. 1. 根据现有的数据库生成表的format文件(导入导出数据的时候需要) bcp db_test.dbo.Table1 format nul -c ...

  2. Run same command on all SQL Server databases without cursors

    original: https://www.mssqltips.com/sqlservertip/1414/run-same-command-on-all-sql-server-databases-w ...

  3. SQL Server - SQL Server/ bcp 工具如何通信

    问题-BCP通讯 ref: https://stackoverflow.com/questions/40664708/bcp-cannot-connect-to-aws-sql-server-but- ...

  4. OGG-00782 - OGG 11.2.1.0.2 FOR Windows x64 Microsoft SQL Server

    OS ENV:主机名:           WIN-NO42QRNPMFAOS 名称:          Microsoft Windows Server 2008 R2 Datacenter OS ...

  5. SQL Server 2008性能故障排查(三)——I/O

    原文:SQL Server 2008性能故障排查(三)--I/O 接着上一章:CPU瓶颈 I/O瓶颈(I/O Bottlenecks): SQLServer的性能严重依赖I/O子系统.除非你的数据库完 ...

  6. Ubuntu 安装 SQL Server

    SQL Server现在可以在Linux上运行了!正如微软CEO Satya Nadella说的,"Microsoft Loves Linux",既Windows 10内置的Lin ...

  7. SQL Server 扩展事件

    SQL Server 扩展事件(Extended Event)是用于服务器的常规事件处理系统,是追踪SQL Server系统运行状态的神器,同时也是一个日志记录工具,扩展事件完全可以取代SQL追踪(S ...

  8. How can I create a dump of SQL Server?

    https://blogs.msdn.microsoft.com/askjay/2009/12/29/basic-debugging-concepts-and-setup/ You can creat ...

  9. [转]UTF-8 encoding support for the BCP utility and BULK INSERT Transact-SQL command in SQL Server 2014 SP2

    本文转自:https://support.microsoft.com/en-us/help/3136780/utf-8-encoding-support-for-the-bcp-utility-and ...

随机推荐

  1. vim插件之SnipMate

    SnipMate简介 snipMate一款功能强大的代码补齐插件,可自定义代码模板,并具备单词补齐的功能. vim插件snipMate下载地址 SnipMate安装 将snipMate.zip解压到~ ...

  2. ASP.NET中Button控件的CommandName和CommandArgument属性用法

    在Repeater中的使用: <asp:Repeater ID="rptActionList" runat="server" OnItemCommand= ...

  3. kvm介绍

    KVM(Kernel-Based Virtual Machines)是一个基于Linux内核的虚拟化技术, 可以直接将Linux内核转换为Hypervisor(系统管理程 序)从而使得Linux内核能 ...

  4. MongoDB数据库的主从配对与迁移示例

    数据中心在运行中有可能遇到各种硬件.电力.网络故障等问题,需要设计良好的系统来隔离,尽量减少对上层应用的影响,持续对外提供服务:一旦发生业务中断,也应尽快恢复.通过主从备份设计,在主应用系统发生故障时 ...

  5. 分享:PHP获取MAC地址的实现代码

    原文地址:http://www.jbxue.com/article/12635.html发布:thatboy   来源:Net     [大 中 小] 分享一例php取得机器mac地址的代码,学习下p ...

  6. Spark官方文档——本地编写并运行scala程序

    快速开始 本文将介绍如何用scala.java.python编写一个spark单击模式的程序. 首先你只需要在一台机器上成功建造Spark:做法: 进入Spark的根目录,输入命令:$ sbt/sbt ...

  7. DIV JS CSS 轻量级弹出层 兼容各浏览器

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  8. DataTable使用总结

    1.DataTable数据去重 static void Main(string[] args) { DataTable dt = new DataTable();//创建表 DataColumn dc ...

  9. 算法系列1《DES》

    1. DES算法简介 DES算法全称为Data Encryption Standard,即数据加密算法,它是IBM公司于1975年研究成功并公开发表的.DES算法的入口参数有三个:Key.Data.M ...

  10. StyleCop学习笔记——默认的规则

    在StyleCop中有一些官方自己写好的检测规则下面就是英文的解释 文档规则 1.SA1600:ElementsMustBeDocumented元素必须添加注释 2.SA1601: PartialEl ...