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
- 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
- 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)
- Cancel the "Use Simple File Sharing" method: Explorer \ tools \ folder Options \ View \ Remove the tick in front of "Use Simple File Sharing (recommended)".
- 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