RE: copying MS SQL tables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You need isql.exe to create a table on the remote machine if you 
want to do everything in a script, alternatively you can create
the table with php and mssql_query().

On Thu, 2004-03-18 at 15:55, Gerardo Rojas wrote:
> OK, i'm able to copy over data using bcp, how do I take this file and create a table into another remote db server.  It fails on the name (of the table) because it doesn't exist yet.
> 
> bcp $tablename in $sourcefile $myargs
> 
> --
> Gerardo S. Rojas
> mailto: grojas@xxxxxxxxxxxxxxxx
> 
> 
> -----Original Message-----
> From: Svensson, B.A.T. (HKG) [mailto:B.A.T.Svensson@xxxxxxx]
> Sent: Wednesday, March 17, 2004 2:12 PM
> To: Gerardo Rojas
> Subject: RE:  copying MS SQL tables
> 
> 
> In the command shell, just type "bcp"and it will output the paramters.
> 
> Typical you should run it like this for import (from memory):
> 
> bcp <db>..<table> in <input file> -a1000 -b1024 -c -S<servername>
> <-P<passwd> -U<user> | -T>  -t\t -r\t
> "
> 
> like:
> 
> bcp mydb..testtable in testdata.txt -a1000 -b1024 -c -S127.0.0.1 -R -r\t
> -t\t
> 
> a: batch size
> b: packet size
> c: charchater data (needed if data is a text file)
> S: sername
> P: passwd
> U: user name
> T: trusted
> t: filed delimiter (\t == tab, char(9))
> r: row delimiter (it can be buggy with \n)
> 
> The order of the parma does not matter.
> 
> To dump data use key word "out" in stead of "in".
> 
> -----Original Message-----
> From: Gerardo Rojas
> To: Svensson, B.A.T. (HKG)
> Sent: 17-3-2004 21:00
> Subject: RE:  copying MS SQL tables
> 
> Svensson,
> 
> can you provide a quick example of using bcp.  When I run my script i
> know what the table will be.  Don't know what parameters are need and in
> what order.  It complains about the direction.
> 
> 
> --
> Gerardo S. Rojas
> mailto: grojas@xxxxxxxxxxxxxxxx
> 
> 
> -----Original Message-----
> From: Svensson, B.A.T. (HKG) [mailto:B.A.T.Svensson@xxxxxxx]
> Sent: Wednesday, March 17, 2004 1:58 PM
> To: 'Frank M. Kromann '
> Cc: ''php-windows@xxxxxxxxxxxxx' '
> Subject: RE:  copying MS SQL tables
> 
> 
> > use the Data Transformation Service (import/export)
> [...]
> > another. Thats the fastest way to do this.
> 
> How many rows is it in the tables you copy?

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux