Not logged in - Login

SQL Bulk Export / Import Example

The following is an example of how to use the BCP.exe utility in SQL to export data out of a database and into another database.

Export data

Open a command prompt and enter the following to export the data from table 'MyTable' and save it to a data file called 'MyTable.dat'
BCP SourceDB.dbo.MyTable out "C:\data export\MyTable.dat" -T -N

Import Data

Open a command prompt and enter the following to import the data from a data file called 'MyTable.dat' into a table called 'MyTable'
BCP DestDB.dbo.MyTable in "C:\Import Data\MyTable.dat" -T -N