Implementing reading of other server files in the LAN through ' Net mapping ' SQL Server

Source: Internet
Author: User

Implementing the Environment

Application Server: Iis6.0+windows Server2003

Database server: SQL 2005+windows Server2003

Research Reasons

before the database server and the Web server on the same server, the database server and the Web server are placed in a different location for special reasons, In order to achieve fast data export in SQL Server database, many methods have been tried, but when the amount of data is too large, the export speed is very slow.  eventually, with the help of the boss, the problem was solved by creating a folder share and a map of the characters.

file Sharing
    1. To open the Guest account: Right-click on my Computer \ Admin \ user has a guest, double-click to remove the "account has been deactivated" before the tick
    2. Delete the Guest account in the "Deny access to this computer from the network" entry: Run Group Policy (gpedit.msc) \ Local computer \ Computer configuration \ Windows Settings \ Security Settings \ Local Policies \ User Rights Assignment \ Deny access to this computer from the network. If there is a guest, it is deleted. (The reason is: sometimes XP guest is not allowed to access the shared)
    3. Cancel the "Use Simple File Sharing" method: Explorer \ tools \ folder Options \ View \ Remove the tick in front of "Use Simple File Sharing (recommended)".
    4. Right-click the file you are sharing, \ properties \ Share, click Share .
Drive Letter mapping

< Span style= "FONT-SIZE:18PX;" > The fastest export data needs to be applied to sp_ Cmdshell A stored procedure that calls a DOS command for data export.

The export T-SQL statement is: EXEC master. xp_cmdshell ' bcp \ ' select * from tableName \ "queryout \" map drive letter path \ "-c-q-u" sa "-P" 123 ". This exports only the table data, and without the table header, we create an export header by the number of Tables to store data headers and export the headers in the same way.

eg:Create map: exec master. xp_cmdshell ' net use N: \\192.168.0.123\DDGL "password"/user:192.168.0.123\administrator/persistent:yes 'Delete mappings: exec master. xp_cmdshell ' net use N:/del '

Implementing reading of other server files in the LAN through ' Net mapping ' SQL Server

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.