My random rumblings

Something of everything and nothing at all

SQL Server Table Export and Import

The data of a table in SQL Server can be exported using the following command

C:\>bcp "<db name>.<schema>.<table_name>" out "d:\roadinfo.bin" -T -n -S .

A query can also be used by changing out to outquery.

Ensure that the destination table on the destination database has the same layout.

C:\>bcp "<db name>.<schema>.<table_name>" in "d:\roadinfo.bin" -n -S <server_name> -U <username> -P <password>

 

Loading