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. 如何解决谷歌浏览器下jquery无法获取图片的尺寸

    代码如下: $(document).ready(function(){ var img_h=$img.height(); var img_w=$img.width(); }) 以上代码在IE和火狐中没 ...

  2. POJ C++程序设计 编程题#1 编程作业—STL1

    编程题#1 来源: POJ (Coursera声明:在POJ上完成的习题将不会计入Coursera的最后成绩.) 注意: 总时间限制: 1000ms 内存限制: 65536kB 描述 下面的程序输出结 ...

  3. Winform登录、控制软件只运行一次、回车登录

    Winform登录对很多程序猿来说都有些困惑,登录进入主窗体后要销毁登录窗体,而不是隐藏哦,怎么实现呢? 先贴一段Program.cs的代码 static void Main() { Mutex mu ...

  4. WPF—TreeView无限极绑定集合形成树结构

    1.如图所示:绑定树效果图 2.前台Xaml代码: <Window x:Class="WpfTest.MainWindow" xmlns="http://schem ...

  5. C# Async与Await用法

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...

  6. ansible的playbook组件

    playbook的核心元素: tasks: 任务 variables: 变量 templates: 模板 handlers: 处理器 roles: 角色 组织格式:YAML(被称为另外一种标记语言) ...

  7. Centos 7.1+CDH5.7.2全部署流程

    前期准备: JDK环境 版本:jdk-8u101-linux-x64.rpm 下载地址:oracle官网 mysql rpm包:http://dev.mysql.com/get/Downloads/M ...

  8. php循环创建目录

    代码取自thinkphp中: function mk_dir($dir, $mod = 0777) { if(!is_dir($dir) || mkdir($dir, $mod)) { if(!mk_ ...

  9. MVC 区分是哪按键提交FORM

    原理: 引用model(@model modelName)的画面,提交到后台的model对象,属性与前台post标签name属性对应来获取值. 前台: @model myModel @using(Ht ...

  10. WPF Canvas 画区域

    有时候需要实现类似于QQ截图那样的选择区域功能,这里的区域可以是一条线,圆,矩形等等 实现原理就是一个Canvas做蒙板,然后canvas的三个事件,MouseLeftButtonDown,Mouse ...