Test BCP export and query a text file

Source: Internet
Author: User

Xp_mongoshell 'bcp "select * From sysobjects" queryout D:/w1.txt-T "|"-S 127.0.0.1-U sa-p-C'

If the-C parameter is not specified, a confirmation message is displayed for the format of each row.

Queryout and out. For query, it must be queryout. BCP has strict requirements and must be specified as queryout.

The BCP command is located in the directory program files/Microsoft SQL Server/80/tools.

 

Try again today

Xp_cmdshell 'bcp "select. *, JZ = MZ-PZ, B. dwmc, C. zgxm as sby, D. zgxm as msby, H. wzmc from balance .. zy_czjl a join balance .. jb_dw B on. khdh = B. dwbh join balance .. jb_zg C on. pzsby = C. zgbh join balance .. jb_zg D on. mzsby = D. zgbh join balance .. jb_wz h on. wzbh = H. wzbh where khdh = '24' and. wzbh = ''07 ''" queryout D:/w1.txt-T "|"-S 127.0.0.1-U sa-P dotbit20042626-C'

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.