Importing and Exporting Data

Importing data is the process of retrieving data from sources external to Microsoft® SQL Server™, for example, an ASCII text file, and inserting the data into SQL Server tables. Exporting data is the process of extracting data from SQL Server into some user-specified format, for example, copying the contents of a SQL Server table to a Microsoft Access database.

Importing data from an external data source into SQL Server is likely to be the first step you perform after setting up your database. After data has been imported into your SQL Server database, you can start to work with the database.

Importing data into SQL Server can be a one-time occurrence; for example, when migrating data from one database system to a SQL Server database because SQL Server is replacing the previous system. After the initial migration is complete, the SQL Server database is used directly for all data-related tasks, rather than the original system. No further data imports may be required.

Importing data can also be an ongoing task. For example, a new SQL Server database is created for executive reporting purposes, but the data resides in legacy systems updated from a large number of business applications. In this case, a daily or weekly import process can be created to copy new or updated data from the legacy system to SQL Server.

Exporting data is usually a less frequent occurrence. SQL Server provides a variety of tools and features that allow applications, such as Access or Microsoft Excel, to connect and manipulate data directly, rather than having to copy all the data from SQL Server to the tool before manipulating. Data may need to be exported from SQL Server regularly if, for example, SQL Server needs to feed data to another business application. In this case, the data can be exported from SQL Server to a text file, and then read from the text file by the application. Alternatively, data can be copied on an ad hoc basis if, for example, a user wanted to extract data from SQL Server into a Excel spreadsheet running on a portable computer, and take the computer on a business trip.

SQL Server provides tools for importing and exporting data to and from a variety of data sources including text files, ODBC data sources (such as Oracle databases), OLE DB data sources (such as other servers running SQL Server), ASCII text files, and Excel spreadsheets.

Additionally, SQL Server replication allows data to be distributed across an enterprise, copying data between locations and synchronizing changes automatically between different copies of data.

  


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