MSSQL bcp usage

Source: Internet
Author: User

Export data using SQL statements

1 bcp "select * from info..info where date between 2010-02-01 and
2 2010-02-04 "queryout" d: info. out "-SST0P-PCSQLEXPRESS-Usa-P123456-c

Direct Export of database table data

1 bcp database name. dbo. Table name out d: Table name. dat-T-n

Where the ST0P-PCSQLEXPRESS after-S is my local server name
-U is followed by the user name
-P is followed by the password

Enter bcp /? View help

Usage: bcp {dbtable | query} {in | out | queryout | format} Data File
[-M maximum error count] [-f format file] [-e error file]
[-F First line] [-L last line] [-B batch size]
[-N local type] [-c character type] [-w width character type]
[-N keeps non-text as the local type] [-V file format version] [-q quoted identifier]
[-C code page description] [-t field Terminator] [-r line terminator]
[-I input file] [-o output file] [-a packet size]
[-S server name] [-U user name] [-P Password]
[-T trusted connection] [-v version] [-R allows region settings]
[-K reserved null value] [-E reserved id value]
[-H "loading prompt"] [-x generates an xml format file]

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.