打印本文 打印本文 关闭窗口 关闭窗口
usage of bcp command.(快来看)。
作者:武汉SEO闵涛  文章来源:敏韬网  点击数4358  更新时间:2009/4/22 23:09:59  文章录入:mintao  责任编辑:mintao
r than the value of -T or the default, bcp does  not send the overflow.
-U username
specifies an Adaptive Server login name. If you do not  specify username, bcp uses  the current user's operating system login name.
-z language
is the official name of an alternate language the  server uses to display bcp prompts and messages.  Without the -z flag, bcp uses  the server's default language. You can add languages to  an Adaptive Server during installation or afterward, using the langinst utility  or the sp_addlanguage stored procedure.
The following error message will appear if an incorrect or  unrecognized language is named with the -z parameter: 
Unrecognized localization object. Using default  value 'us_english'.
Starting  copy...
 => warning.
-v 
reports the current version and copyright message  of the bcp program.
Examples 
Example  1 
bcp pubs2..publishers out pub_out  -c -t , -r \r
Copies data out of the publishers table  in character format (using char for all fields)  using the -c parameter. The -t field_terminator parameter  ends each field with a comma, and the -r row_terminator parameter  ends each line with a Return. bcp prompts only  for a password.
Example  2 
bcp pubs2..publishers out pub_out
Password:
Enter the  file storage type of field pub_id [char]:
Enter  prefix length of field pub_id [0]:
Enter  length of field pub_id [4]:
Enter  field terminator [none]:
Enter the file  storage type of field pub_name [char]:
Enter  prefix length of field pub_name [1]:
Enter  length of field pub_name [40]:
Enter  field terminator [none]:
Enter the file  storage type of field city [char]:
Enter  prefix length of field city [1]:
Enter  length of field city [20]:
Enter field  terminator [none]:
Enter the file storage  type of field state [char]:
Enter prefix  length of field state [1]:
Enter length  of field state [2]:
Enter field terminator [none]:
Copies data from the publishers table  to a file named pub_out for later reloading  into Adaptive Server. Press Return to accept the defaults specified by the  prompts. The same prompts appear when you copy data into the publishers table.
Example  3 
bcp pubs2..publishers out pub_out  -c -t , -r \r
Copies data out of the publishers table  in character format (using char for all fields).  The -t field_terminator parameter  ends each field with a comma, and the -r row_terminator parameter  ends each line with a Return. bcp prompts only  for a password.
Example  4 
bcp pubs2..publishers out pub_out
Password:
Enter the  file storage type of field pub_id [char]:
Enter  prefix length of field pub_id [0]:
Enter  length of field pub_id [4]:
Enter  field terminator [none]:
Enter the file  storage type of field pub_name [char]:
Enter  prefix length of field pub_name [1]:
Enter  length of field pub_name [40]:
Enter  field terminator [none]:
Enter the file  storage type of field city [char]:
Enter  prefix length of field city [1]:
Enter  length of field city [20]:
Enter field  terminator [none]:
Enter the file storage  type of field state [char]:
Enter prefix  length of field state [1]:
Enter length  of field state [2]:
Enter field terminator [none]:
Copies data from the publishers table  to a file named pub_out for later reloading  into Adaptive Server. Press Return to accept the defaults specified by the  prompts. The same prompts appear when you copy data into the publishers table.
Usage 
稴ee Chapter 2, "Using  bcp to Transfer Data to and from Adaptive Server" for an  in-depth discussion of bcp.
稴ee the Performance and Tuning Guide for more  information on how changing certain parameters can affect bcp for  large batches.
穊cp provides a convenient, high-speed  method for transferring data between a database table or view and  an operating system file. bcp can read or write  files in a wide variety of formats. When copying in from a file, bcp inserts  data into an existing database table; when copying out to a file, bcp overwrites  any previous contents of the file.
穀ou cannot copy into a view from an operating system  file.
稶pon completion, bcp informs  you of the number of rows of data successfully copied, the total  time the copy took, the average amount of time, in milliseconds,  that it took to copy one row and the number of rows copied per second.
稵he current version of bcp ignores  the -y sybase_directory parameter.
穀ou cannot use named pipes to copy files in or out.
稥rror message format is different than previous  versions of bcp. If you have scripts that perform  routines based on the values of these messages you may need to re-write  them, for example:
The display message that indicates the number of rows transferred  has been changed. During a session, this version of bcp periodically  reports a running total of rows transferred. This message replaces  the "1000 rows transferred" message displayed  by the previous bcp.
稤o not use -t or -r parameters  with bcp in native format. Results are unpredictable  and data could become corrupted.
Copying Tables with Indexes or Triggers
稵he bcp program  is optimized to load data into tables that do not have indexes or  triggers associated with them. It loads data into tables without indexes  or triggers at the fastest possible speed, with a minimum of logging.  Page allocations are logged, but the insertion of rows is no

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

打印本文 打印本文 关闭窗口 关闭窗口