We recently encountered the following bug in SQL 2012 with the import export wizard.

The problem occurs when you are using a query as the source for the import.  This cause’s data type mapping issues with any varchar datatypes, it changes the data type and prevents the import/export task from completing.  On checking the error message you find the following error

Source data type “nnn” was not found in data type mapping file

Please note that the “nnn’ could be any number.  The Datetimedatatypes may not error but it will convert them to datetime2 datatypes.

This has been reported to Microsoft and will be fixed in a future release.

Below are the 3 workarounds that our consultant has used successfully.

1.     Use a query for the source data

Import/Export Wizard select Write a query to specify the data to transfer


Use a select query


2. Use an Insert Query


3.     Create a view


The latest cumulative update for SQL 2012 SP1 doesn’t fix it, quite possible this will be fixed in the next Service Pack.

This issue doesn’t exist in SQL Server 2014.

Back to blog