Posted by Erland Sommarskog on 12/03/06 15:04
Mark Olbert (ChairmanMAO@newsgroups.nospam) writes:
> I'm not that familiar with BCP (I tended to just use the DTS Wizard in
> Enterprise Manager), but I can read up on it.
As a quick start here is a sample command exporting data out:
bcp database..tbl out tbl.bcp -n -T -S myserver
-n specifies native format, which is the best for moving data between two
SQL Server databases in most cases. -T specifies trusted connection. Use
-U and -P to specify username and password for SQL authentication if
that is what you use.
For importing data to the other server, just change "out" to "in" and the
server name of course. ...but if the table has an identity column you
also need to specify -E to use the values in the file.
If the databases have different collation you need to use a format file.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
[Back to original message]
|