SQL Bulk Export and 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
Last modified by Mohit @ 4/13/2025 8:21:54 PM