SQL query and analysis using net commands

Source: Internet
Author: User

Run the following command in the doscommand (or Bat file:
Net use \ 192.168.100.1 \ ip$ ks-c-001-11/user: administrator
COPY \ 192.168.100.1 \ xm \ XM \ SALE_DBC. * c: \ temp/y
COPY \ 192.168.100.1 \ xm \ XM \ sale07. * c: \ temp/y
COPY \ 192.168.100.1 \ xm \ XM \ sale10. * c: \ temp/y
COPY \ 192.168.100.1 \ xm \ XM \ sale11. * c: \ temp/y
Net use \ 192.168.100.1 \ ipc $/del
Perform the following operations in query analysis:
1. When xp_mongoshell is used, it is best to add "master. dbo." Before the command, because the stored procedure "xp_mongoshell" belongs to the master database.
2. When you set the connection to IPC, the IP address or computer name must be added between "user:" and "user Name.
1. Use an IP address to connect
-- 1. Set connection
EXEC master. dbo. xp_mongoshell 'net use \ 192.168.100.1 \ ipc $ ks-c-001-11/user: 192.168.100.1 \ administrator'
-- 2. Execute the doscommand
EXEC master. dbo. xp_mongoshell 'Copy \ 192.168.100.1 \ xm \ XM \ SALE_DBC. * c: \ temp/Y'
EXEC master. dbo. xp_mongoshell 'Copy \ 192.168.100.1 \ xm \ XM \ sale07. * c: \ temp/Y'
EXEC master. dbo. xp_mongoshell 'Copy \ 192.168.100.1 \ xm \ XM \ sale10. * c: \ temp/Y'
EXEC master. dbo. xp_mongoshell 'Copy \ 192.168.100.1 \ xm \ XM \ sale11. * c: \ temp/Y'
-- 3. Disconnect
EXEC master. dbo. xp_mongoshell 'net use \ 192.168.100.1 \ ipc $/del'
2. Use a computer name to connect
-- 1. Set connection
EXEC master. dbo. xp_mongoshell 'net use \ ks-008 \ ipc $ ks-c-001-11/user: ks-008 \ administrator'
-- 2. Execute the doscommand
EXEC master. dbo. xp_mongoshell 'Copy \ ks-008 \ xm \ XM \ SALE_DBC. * c: \ temp/Y'
EXEC master. dbo. xp_mongoshell 'Copy \ ks-008 \ xm \ XM \ sale07. * c: \ temp/Y'
EXEC master. dbo. xp_mongoshell 'Copy \ ks-008 \ xm \ XM \ sale10. * c: \ temp/Y'
EXEC master. dbo. xp_mongoshell 'Copy \ ks-008 \ xm \ XM \ sale11. * c: \ temp/Y'
-- 3. Disconnect
EXEC master. dbo. xp_mongoshell 'net use \ ks-008 \ ipc $/del'

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.