var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: BCP help please!!
I would like to bulk copy 37 tables out of my development db server
I know how to write a batch file to bulk copy one table for example below I copy the opp_data table in the ipabs database.etc
del /q d:\ipabs_ftp\login.dat
bcp ipabs..opp_data out opp.dat -Usa -PMORPHEUS1 -Sipabs -c
move opp.dat d:\ipabs_ftp\opp.dat
My question is how do I copy all 37 tables to the same output file
what adjustments would I have to make to the above script
I'll assume you're using Windows NT (2000 works and XP should as well) somewhere, because the following won't work on Win 85, 98, or ME
echo. > all_tables.txt
for /f %%t in (tables.txt) do (
bcp rwc..%%t out %%t.txt -Uuser_name -Sserver_name -Ppassword -c
copy all_tables.txt + %%t.txt all_tables2.txt
move all_tables2.txt all_tables.txt
This will work for any number of tables. Just put each table on its own line in a file called "tables.txt". Obviously you will need to specify your user name, server name and password.
The resulting file is called "all_tables.txt" There is a blank line at the start of the file, but I think that's a small price to pay.
If you're going to be doing this kind of thing regularly think about obtaining Cygwin becuase then you have a more powerful scripting (bourne shell) at your disposal.
thanks so much, I'll try it.