The SQL Server Import and Export Wizard helps you quickly move data between databases, files, or other data sources without writing complex scripts. It is ideal for one-time loads, migrations, or testing, and requires only basic permissions and a clear understanding of your source and destination structures.

What You'll Need

  • SQL Server Management Studio (SSMS) installed (version matching your SQL Server instance)
  • Appropriate permissions: at least db_datareader on source and db_datawriter on destination
  • Source data accessible (e.g., flat file, Excel, another database)
  • Destination database or file ready to receive data
  • Knowledge of data types and potential conversion issues between source and target

Step-by-Step

  1. Open SQL Server Management Studio and connect to the SQL Server instance where you want to run the wizard (this can be the source, destination, or a separate management server).
  2. In Object Explorer, right-click the destination database (or source database if exporting), choose Tasks, then select either Import Data... or Export Data... depending on your direction.
  3. Click Next on the welcome screen to proceed to the Choose a Data Source step.
  4. Select the appropriate data source provider (e.g., Flat File Source, Excel, OLE DB, or .NET Framework Data Provider for SQL Server). Configure the connection string, file path, or server details as required. For flat files, specify format (delimited or fixed width), text qualifier, and code page.
  5. Click Next to move to Choose a Destination. Select the destination provider (typically SQL Server Native Client or OLE DB for SQL Server). Enter the server name, authentication method, and target database. Verify the connection succeeds.
  6. Click Next to reach Specify Table Copy or Query. Choose Copy data from one or more tables or views for a simple transfer, or Write a query to specify the data to transfer if filtering or joining is needed.
  7. If copying tables, select the source objects you wish to import. For each selected item, you can click Edit Mappings to review and adjust column mappings, data types, and destination column names.
  8. In the Edit Mappings dialog, ensure each source column maps correctly to a compatible destination column. Use the dropdown to change data types if conversion is needed (e.g., converting VARCHAR to DATE). Check Enable identity insert if preserving identity values is required.
  9. Click OK to save mappings, then return to the wizard and click Next to reach the Save and Run Package step.
  10. Choose Run immediately to execute the import now, or Save SSIS Package to reuse the configuration later. If saving, specify a location (file system or SQL Server) and optionally set package protection level.
  11. Click Next to view the Completing the Wizard summary. Review all settings carefully, especially source/destination, mappings, and runtime options.
  12. Click Finish to execute the import. The wizard will display progress and report success or any errors encountered per table or batch.
  13. After completion, click Close. Validate the imported data in the destination using SELECT queries to check row counts, nulls, and data integrity.

Common Mistakes

  • Mismatched data types causing truncation or conversion failures (e.g., importing a long string into a VARCHAR(50) column).
  • Overlooking nullable vs. non-nullable column settings, leading to insert errors when source contains NULLs.
  • Forgetting to disable triggers or constraints temporarily if they interfere with the load (though this should be done cautiously).
  • Using the wrong code page for flat files, resulting in garbled characters (especially with UTF-8 or international text).
  • Not setting Enable identity insert when trying to preserve existing identity values, causing duplicate key errors.
  • Saving the package with sensitive passwords unencrypted if saved to file system without proper protection.

Tips

  • Always run a test import with a small subset of data (e.g., top 100 rows) to validate mappings and catch type issues early.
  • Use the Preview feature in the data source step to verify how the wizard interprets your flat file structure (delimiters, row headers).
  • For recurring tasks, save the SSIS package and schedule it via SQL Server Agent instead of repeating the wizard manually.
  • When importing dates from text, ensure the source format matches the destination’s expectations or use a derived column in the mapping to convert via expressions.
  • Check the Execution log after import (visible in the wizard results) for warnings about truncation or converted rows.
  • If importing into a production database, schedule the load during off-peak hours and consider wrapping in a transaction if using saved SSIS packages with manual control.

Troubleshooting

  • If the wizard fails to connect, verify network connectivity, SQL Server Browser service (for named instances), and firewall rules allowing traffic on the SQL Server port (default 1433).
  • For authentication errors, confirm your login has permission on both source and destination, and that SQL Server Authentication is enabled if not using Windows Auth.
  • When flat file imports fail due to formatting, open the file in a text editor to check for inconsistent delimiters, extra columns, or unexpected line breaks.
  • If data truncation occurs, increase the destination column size or use staging tables with larger varchar columns before moving to final tables.
  • For slow performance on large imports, consider enabling bulk insert optimizations by ensuring the destination table has no indexes or triggers during load (rebuild after), and use the wizard’s option to commit rows in batches.
  • If the wizard crashes or hangs, try reducing the number of rows per commit or importing one table at a time to isolate the issue.

Frequently Asked Questions

Can I import data from an Excel file using the wizard?

Yes, select the Microsoft Excel provider as the data source and specify the file path and worksheet. Note that the Jet/ACE provider must be installed and match your SSMS bitness (32-bit or 64-bit).

Do I need to create the destination table before importing?

No, the wizard can create the destination table automatically based on source metadata. However, you cannot modify constraints or indexes during creation—consider pre-creating the table if you need specific settings.

Why are my datetime values importing as 1900-01-01?

This usually indicates a conversion failure where the source text does not match a valid date format. Check the source data for invalid entries and ensure the destination column is a proper date/time type.

Can I schedule the import to run automatically?

Only if you save the SSIS package. You can then import it into SSIS and schedule execution via SQL Server Agent. The wizard itself does not support scheduling.

What happens if I import data into a table with an identity column?

By default, the wizard will not preserve identity values and will generate new ones. To keep existing identity values, you must enable Enable identity insert in the column mappings for that column.

Is the wizard suitable for large-scale data migrations?

For one-time or infrequent loads, yes. For frequent, large, or complex ETL processes, consider using SSIS packages directly for better control, logging, and error handling.