Batch processing of data through BCP guide table

Source: Internet
Author: User

rem echo offrem  Service Data Synchronization script rem  variable settings rem sql command path set sql_bin= "c:\program files\ Microsoft sql server\100\tools\binn\sqlcmd. EXE "rem bcp command path set bcp_bin=" c:\program files\microsoft sql server\100\tools\binn\ Bcp.exe "rem  Basic directory set base_dir=%~dp0rem  setting source database information set so_user=" test "set so_pass=" test "set  so_host= "192.168.1.22" set so_db=testset so_table=t1set so_table1=t2rem  set target database information set  des_user= "test" set des_pass= "test" set des_host= "127.0.0.1" Set des_db=testset des_ table=t1set des_table1=t2echo  Exporting table Data  %bcp_bin% %so_db%.dbo.%so_table% out %base _dir%%so_table%%date:~0,4%%date:~5,2%%date:~8,2%.csv -c -t "' | '"  -r "| | |"   -U %SO_USER% -P %SO_PASS% -S %SO_HOST%echo  Importing table Data%bcp_bin% %d es_db%.dbo.%d Es_table% in %base_dir%%so_table%%date:~0,4%%date:~5,2%%date:~8,2%.csv -c&nBsp;-t "' | '"  -r "| | |"  -u %des_user% -p %des_pass% -s %des_host% del %base_dir%%so_table%% date:~0,4%%date:~5,2%%date:~8,2%.csv echo  Exporting table Data  %BCP_BIN% %SO_DB%.dbo.%SO_TABLE1%  Out %base_dir%%so_table1%%date:~0,4%%date:~5,2%%date:~8,2%.csv -c -t "' | '"  -r "| | |"   -U %SO_USER% -P %SO_PASS% -S %SO_HOST%echo  Importing table Data%bcp_bin% %d es_db%.dbo.%d Es_table1% in %base_dir%%so_table1%%date:~0,4%%date:~5,2%%date:~8,2%.csv -c -t "' | '"  -r "| | |"  -u %des_user% -p %des_pass% -s %des_host% del %base_dir%%so_table1%% Date:~0,4%%date:~5,2%%date:~8,2%.csv


This article is from the "Dead Leaf" blog, please make sure to keep this source http://mydbs.blog.51cto.com/513727/1745292

Batch processing of data through BCP guide table

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.