zoukankan      html  css  js  c++  java
  • BCP command usage in SQL Server

    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.


     

  • 相关阅读:
    利用ItextPdf、core-renderer-R8 来生成PDF
    把war包放到Tomcat安装文件夹下,不能直接訪问的解决方式
    我的RTOS 之六 -- Touch移植(s5pv210+threadx+ucgui+touch)
    数据库可用率监控工具
    9款极具创意的HTML5/CSS3进度条动画(免积分下载)
    ODBC与JDBC比較
    ORA-02287: 此处不同意序号
    mongodb创建、更新、删除
    jcenter那些事儿
    C#里的应用程序域AppDomain
  • 原文地址:https://www.cnblogs.com/IcanFixIt/p/4654801.html
Copyright © 2011-2022 走看看