There are a number of ways to import and export data with SQL Server 2000. Bulk copy is one of them. In this article Mitchell introduces us to basic import/export functionality with the bulk copy command utility.
An Introduction To The Bulk Copy Utility (Page 1 of 5 )
Picture this. You have to export 100,000 rows of customer information from your SQL Server 2000 database into an SQL-native file format for importing into a database half way across the world.
These rows of data will be used to populate a customer database for your new office opening in Paris. Each row needs to have its data values preserved and because you’re exporting 100,000 rows of data, the export needs to be quick. Very quick.
What do you use?
SQL Server comes with a number of different ways to quickly import and export data from various sources and in various formats. Basically, there are three methods that we could use to do it:
Use the bulk copy API's to write a custom C++ application to extract and then import the rows from the database.
Use data transformation services (DTS) to create a package to handle the export and re-import of the rows.
Use the bcp.exe command line utility to both import and export the rows to a file.
In this article we're going to take a look at using the bulk copy utility that ships with SQL Server to import and export rows quickly and easily from the command line.
To implement the bulk copy sample that we're going to look at in this article, you should be sitting in front of a PC where SQL Server 7/2000 is installed. You should have unrestricted administrative privileges at both the operating system and database level.