title: Error while importing flat file "Microsoft.SqlServer.Prose.Import"
body: <p>I am getting error while inserting flat file into SQL Server. Direct transfer from SQL Server to SQL Server is not possible. Data has to be exported and then imported. Note : Data was exported from SQL server with text qualifier "double quotes" and pipe delimited "|". I tried to re-extract the data using fixed width format still unable to import. Please assist. </p>
  
  <h1>Error Message :</h1>
  
  <p>Error inserting data into table. (Microsoft.SqlServer.Import.Wizard)</p>
  
  <pre><code>------------------------------
  Program Location:
  
  
  
   at Microsoft.SqlServer.Import.Wizard.InsertData.ResultCheck(Result result)
     at Microsoft.SqlServer.Import.Wizard.InsertData.DoWork()
     at Microsoft.SqlServer.Management.TaskForms.SimpleWorkItem.Run()
  
  ===================================
  
  Error inserting data into table. (Microsoft.SqlServer.Prose.Import)
  
  ------------------------------
  Program Location:
  
     at Microsoft.SqlServer.Prose.Import.BcpSynthesis.InsertIntoDB(String inputFilePath, String tableName, String schemaName, SqlConnection connection, Int32 batchSize, SqlTransaction transaction)
     at Microsoft.SqlServer.Prose.Import.BcpProcess.&lt;&gt;c__DisplayClass42_0.&lt;InsertIntoDb&gt;b__0()
     at Microsoft.SqlServer.Prose.Import.BcpProcess.ExecuteOperation(Action operation)
  
  ===================================
  
  Object reference not set to an instance of an object. (Microsoft.SqlServer.Prose.Import)
  
  ------------------------------
  Program Location:
  
     at Microsoft.SqlServer.Prose.Import.OutputDataReader.GetValue(Int32 i)
     at System.Data.SqlClient.SqlBulkCopy.GetValueFromSourceRow(Int32 destRowIndex, Boolean&amp; isSqlType, Boolean&amp; isDataFeed, Boolean&amp; isNull)
     at System.Data.SqlClient.SqlBulkCopy.ReadWriteColumnValueAsync(Int32 col)
     at System.Data.SqlClient.SqlBulkCopy.CopyColumnsAsync(Int32 col, TaskCompletionSource`1 source)
     at System.Data.SqlClient.SqlBulkCopy.CopyRowsAsync(Int32 rowsSoFar, Int32 totalRows, CancellationToken cts, TaskCompletionSource`1 source)
     at System.Data.SqlClient.SqlBulkCopy.CopyBatchesAsyncContinued(BulkCopySimpleResultSet internalResults, String updateBulkCommandText, CancellationToken cts, TaskCompletionSource`1 source)
     at System.Data.SqlClient.SqlBulkCopy.CopyBatchesAsync(BulkCopySimpleResultSet internalResults, String updateBulkCommandText, CancellationToken cts, TaskCompletionSource`1 source)
     at System.Data.SqlClient.SqlBulkCopy.WriteToServerInternalRestContinuedAsync(BulkCopySimpleResultSet internalResults, CancellationToken cts, TaskCompletionSource`1 source)
     at System.Data.SqlClient.SqlBulkCopy.WriteToServerInternalRestAsync(CancellationToken cts, TaskCompletionSource`1 source)
     at System.Data.SqlClient.SqlBulkCopy.WriteToServerInternalAsync(CancellationToken ctoken)
     at System.Data.SqlClient.SqlBulkCopy.WriteRowSourceToServerAsync(Int32 columnCount, CancellationToken ctoken)
     at System.Data.SqlClient.SqlBulkCopy.WriteToServer(IDataReader reader)
     at Microsoft.SqlServer.Prose.Import.BcpSynthesis.InsertIntoDB(String inputFilePath, String tableName, String schemaName, SqlConnection connection, Int32 batchSize, SqlTransaction transaction)
  </code></pre>