Importing Data from a Text File Example

As an example, the general steps required to import data to Microsoft® SQL Server™ from a text file using the DTS Import Wizard are:

  1. Choose Text File as the data source, and enter the name of the text file containing the data to be imported.
  2. Determine the format of the text file because this describes how the fields are separated from one another.
Use this To do this
Delimited Align data within the file into fields, each delimited with a terminating character. All fields must be delimited with the same terminating character.
Fixed Field Align data within the file into fields of equal width. A field within the file has the same width for all rows of data. Each field can have a different width from other fields within the same row, however.
File Type Choose ANSI or Unicode, depending on the type of data in the file.
Row Delimiter Separate one row in the file from the next with a character sequence. Choose from:

{CR}{LF} Carriage Return Line Feed
{CR} Carriage Return
{LF} Line Feed
Semicolon
Comma
Tab
Vertical Bar
<none>
You can also type in a character to use as the row delimiter.

Text Qualifier Enclose text fields character used. Choose from:

Double Quotation mark {"}
Single Quotation mark {'}
<none>
You can also type in a character to use as the text qualifier.

Skip Rows Enter the number of rows from the start of the file to skip being copied.
First row has column names Specify that the first row in the text file has column headings rather than data.

  1. If the text file is delimited, specify the field delimiter.
  2. If the text file is fixed-field, specify the width of each field.
  3. Enter the destination table for the imported data.
  4. Specify any transformation requirements.
  5. Perform the import.

  


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