Choosing a Tool to Import or Export Data

Data can be imported and exported from Microsoft® SQL Server™ using several tools and Transact-SQL statements. You can also write your own programs to import and export data using the programming models and application programming interfaces (APIs) available with SQL Server.

Methods for copying data to and from SQL Server include:

It is possible to select data from an arbitrary OLE DB provider, allowing data to be copied from external data sources into SQL Server.

A distributed query that selects data from another data source can also be used to specify the data to be inserted.

For more information, see Distributed Queries.

The method chosen to import or export data depends on a variety of user requirements, the most common being:


Required
functionality

DTS
wizards


Replication


bcp

BULK
INSERT
SELECT
INTO /
INSERT
Import text data YES   YES YES YES (1)
Export text data YES   YES    
Import from ODBC data sources YES YES      
Export to ODBC
data sources
YES YES      
Import from OLE DB data sources YES YES     YES (1)
Export to OLE DB data sources YES YES      
Graphical user interface YES YES      
Command prompt/batch scripts YES YES YES    
Transact-SQL scripts   YES   YES YES
Automatic scheduling YES YES YES (2) YES (2)  
Ad hoc import/export YES   YES YES YES
Recurring import/export YES YES YES    
Maximum performance     YES YES  
Data transformation YES        
Programmatic interface YES YES YES    
(1) Using a distributed query retrieving data from an external source by using an OLE DB provider.
(2 ) By explicitly creating a job scheduled using SQL Server Agent.

See Also
bcp Utility Programming DTS Applications
BULK INSERT Data Transformation Services Import and Export Wizards

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.