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.


最新文章

  1. jQuery1.9之后使用on()绑定 动态生成元素的 事件无效
  2. LaTeX Software & Manuals
  3. 腾讯DBA官方博客开通了
  4. SpringMVC实现Restful风格的WebService
  5. Python编写一个Python脚本
  6. Toast提示信息
  7. View绘制详解(二),从setContentView谈起
  8. Qt中gb2312/GBK的URL编解码函数
  9. Android开发8:UI组件TextView,EditText,Button
  10. c++ - Create empty json array with jsoncpp - Stack Overflow
  11. gradle 构建spring源码时候报错
  12. django-表单
  13. 基于jQuery的控件:弹框
  14. C#流程控制语句--分支语句(if,switch,三位运算符)
  15. ecplise多个版本tomcat的使用
  16. Makefile中通过sed命令生成文件系统的selinux的配置文件vendor_filesystem_config.txt
  17. 快速搭建日志系统——ELK STACK
  18. Swift Enum 枚举
  19. T-SQL:事务锁下的并发处理(十五)
  20. Jfrog Artifactory jenkins 流水线使用docker的方式培训[暂未成功]

热门文章

  1. 树莓派(Rospberry Pi B+)到货亲测
  2. jquery 获取元素坐标
  3. Silverlight学习之初始化参数
  4. zabbix介绍
  5. 【转】mysql字符串函数
  6. C++求最小公倍数
  7. SQLServer2005,2000获取表结构:字段名、类型、长度、主键、非空、注释
  8. android属性
  9. 史上最简单的个人移动APP开发入门--jQuery Mobile版跨平台APP开发
  10. Python学习教程(learning Python)--1.2.1 Python输出语句print基本使用