转至繁体中文版     | 网站首页 | 图文教程 | 资源下载 | 站长博客 | 图片素材 | 武汉seo | 武汉网站优化 | 
最新公告:     敏韬网|教学资源学习资料永久免费分享站!  [mintao  2008年9月2日]        
您现在的位置: 学习笔记 >> 图文教程 >> 数据库 >> SyBase >> 正文
usage of bcp command.(快来看)。         ★★★★

usage of bcp command.(快来看)。

作者:闵涛 文章来源:闵涛的学习笔记 点击数:3528 更新时间:2009/4/22 23:09:59

这个是我从Manual上copy下来的,希望对大家有用。

bcp
Description 
  Copies  a database to or from an operating system file in a user-specified format.
Syntax 
bcp [[database_name.]owner.][view_name | table_name    [:partition_id]] {in | out} datafile[-c] [-E] [-n] [-X]
 [-a display_charset]
 [-A size]
 [-b batchsize]
 [-e errfile]
 [-f formatfile]
 [-F firstrow]
 [-g id_start_value]
 [-I interfaces_file]
 [-J client_charset]
 [-L lastrow]
 [-m maxerrors]
 [-P password]
 [-q datafile_charset]
 [-r row_terminator]
 [-R remote_server_principal]
 [-S server]
 [-t field_terminator]
 [-T text_or_image_size]
 [-U username]
 [-z language]
or
bcp -v
Parameters 
database_name
is optional if the table being copied is in your  default database or in master. Otherwise, you  must specify a database name.
owner
is optional if you or the Database Owner owns the  table being copied. If you do not specify an owner, bcp looks  first for a table of that name that you own, and then looks for  one owned by the Database Owner. If another user owns the table,  you must specify the owner name or the command fails.
view_name
is the name of the view you are copying out.
table_name
is the name of the database table to copy.
Partition number partition_number does  not exist in table table_name.
partition_id
is the identifier of the partition into which to  copy.
in | out
is the direction of the copy. in indicates  a copy from a file into the database table; out indicates  a copy to a file from the database table or view.
datafile
is the full path name of an operating system file.  The path name can be from 1 to 255 characters in length.
-c 
performs the copy operation with char datatype  as the default. This parameter does not prompt for each field; it  uses char as the default storage type, no prefixes, \t  (tab) as the default field terminator, and \n (newline)  as the default row terminator.
-E
explicitly specifies the value of a table's  IDENTITY column.
By default, when you bulk copy data into a table with an IDENTITY column, bcp assigns  each row a temporary IDENTITY column value of 0. As bcp inserts  each row into the table, the server assigns the row a unique, sequential  IDENTITY column value, beginning with the value 1. If you specify  the -E flag when copying data into a table, bcp prompts  you to enter an explicit IDENTITY column value for each row. If  the number of inserted rows exceeds the maximum possible IDENTITY  column value, Adaptive Server returns an error.
By default, when you bulk copy data from a table with an IDENTITY column, bcp excludes  all information about the column from the output file. If you specify  the -E flag, bcp copies the  existing IDENTITY column values into the output file.
You cannot use the -E and -g flags  together.
-n 
performs the copy operation using native (operating  system) formats. Specifying the -n parameter  means bcp will not prompt for each field. Files in  native data format are not human-readable.
Warning! Do not use bcp in native format  for data recovery or salvage or to resolve an emergency situation.  Do not use bcp in native format to transport data  between different hardware platforms, different operating systems,  or different major releases of Adaptive Server. Do not use field terminators  (-t) or row terminators (-r)  with bcp in native format. Results are unpredictable  and data could become corrupted. Using bcp in  native format can create flat files that cannot be reloaded into Adaptive Server and  it may be impossible to recover the data. If you are unable to re-run bcp in  character format (for example, a table was truncated or dropped,  hardware damage occurred, a database was dropped, and so on) the  data will be unrecoverable.
-X
specifies that, in this connection to the server,  the application initiates the login with client-side password encryption. bcp (the  client) specifies to the server that password encryption is desired.  The server sends back an encryption key, which bcp uses  to encrypt your password, and the server uses the key to authenticate  your password when it arrives.
-a display_charset
allows you to run bcp from a  terminal where the character set differs from that of the machine  on which bcp is running. Use -a in  conjunction with -J to specify the character  set translation file (.xlt file) required for  the conversion. Use -a without -J only  if the client character set is the same as the default character  set.
The following error message will appear if the character translation  file(s) named with the -a parameter is missing,  or you mistype the name(s): 
Error in  attempting to determine the size of a pair of translation tables.:'stat' utility  failed.
-A size
specifies the network packet size to use for this bcp session.  For example: 
bcp pubs2..titles out table_out  -A 2048
sets the packet size to 2048 bytes for this bcp session. size must  be between the values of the default network packet size and maximum  network packet size configuration variables, and it must  be a multiple of 512.
Use larger-than-default network packet sizes to improve the  performance of large bulk-copy operations.
-b batchsize
is the number of rows per batch of data copied  (the default is to copy all the rows in one batch). Batching

[1] [2] [3] [4] [5]  下一页


[办公软件]如何实现Office工具栏、菜单以及菜单命令重命名  [办公软件]如何在Office文档(大)括号内输入多行文字
[办公软件]如何在office(PowerPoint,Word,Excel)中制作带圈的…  [办公软件]批量删除Office文档(word,excle,powerpoint)中的超…
[办公软件]Office(Word,Excel)密码破解软件(Office Password…  [办公软件]如何让低版本的Office也能顺利编辑2007文档
[办公软件]设置office艺术字的形状  [办公软件]如何将Office菜单设置、工具设置、宏设置等应用到…
[办公软件]在Office(word,excel)中输入各级钢筋符号的方法  [办公软件]打开Office文档就提示安装的原因及解决方案
教程录入:mintao    责任编辑:mintao 
  • 上一篇教程:

  • 下一篇教程:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
      注:本站部分文章源于互联网,版权归原作者所有!如有侵权,请原作者与本站联系,本站将立即删除! 本站文章除特别注明外均可转载,但需注明出处! [MinTao学以致用网]
      网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)

    同类栏目
    · Sql Server  · MySql
    · Access  · ORACLE
    · SyBase  · 其他
    更多内容
    热门推荐 更多内容
  • 没有教程
  • 赞助链接
    更多内容
    闵涛博文 更多关于武汉SEO的内容
    500 - 内部服务器错误。

    500 - 内部服务器错误。

    您查找的资源存在问题,因而无法显示。

    | 设为首页 |加入收藏 | 联系站长 | 友情链接 | 版权申明 | 广告服务
    MinTao学以致用网

    Copyright @ 2007-2012 敏韬网(敏而好学,文韬武略--MinTao.Net)(学习笔记) Inc All Rights Reserved.
    闵涛 投放广告、内容合作请Q我! E_mail:admin@mintao.net(欢迎提供学习资源)

    站长:MinTao ICP备案号:鄂ICP备11006601号-18

    闵涛站盟:医药大全-武穴网A打造BCD……
    咸宁网络警察报警平台