Chapter 5 ADVANCED DATA RETRIEVAL AND MODIFICATION 307
Chapter 5 ADVANCED DATA RETRIEVAL AND MODIFICATION 307 Parameter Function -N Specifies a native mode that is slower than the -n, but that doesn t destroy Unicode. -w Specifies a native mode that s even slower than -N, because it also specifies a tab-delimited file with a newline character. The other native modes can store numbers in binary format, so they are faster. -V Tells BCP to use one of the old SQL Server versions data types for import and export. For an export, this also translates null bit fields to zero, because previous versions didn t handle that. This has no effect on date fields, which are always copied out however ODBC wants to do it. Notice that there is a command-line option -n and another one that s -N. All BCP command-line options are case sensitive. If you don t specify one of -c, -f, -n, -N, or -w, BCP assumes that you don t have a format file, you don t want to use any of the predefined formats, and that you want to make one. It reads the layout of the table you re using and then walks you through a prompted one- column-at-a-time process, and then you can save the file as a format file. Here s an example of a BCP session where BCP is prompting for information: C:Documents and SettingsMILLCS>bcp Chapter5..Sales out .sales.dat -T Enter the file storage type of field PersonID [int-null]: Enter prefix-length of field PersonID [1]: Enter field terminator [none]: Enter the file storage type of field ProductID [int-null]: Enter prefix-length of field ProductID [1]: Enter field terminator [none]: Enter the file storage type of field QtyPurchased [int-null]: Enter prefix-length of field QtyPurchased [1]: Enter field terminator [none]: Enter the file storage type of field DatePurchased [datetime-null]: Enter prefix-length of field DatePurchased [1]: Enter field terminator [none]: Do you want to save this format information in a file? [Y/n] Host filename [bcp.fmt]: Starting copy…
For high quality website hosting services please check cheap web hosting website.