SQL 2008 : Using SQL SSIS Package, I am exporting Excel Sheet to Text File and then Exporting to SQL Database. I decided to follow two steps of Export process as because of datatype mismatch between SQL Database and some of Excel Columns. When there is a mismatch in the Datatype, SSIS Package stops the Export Process but results as SSIS Package ran successfully.
To avoid partial import of Excel sheet, i decided to follow two steps of export. When different datatype of Excel Sheet goes to Text File, it reflect as String. When i am exporting back from Text file to SQL Database,it goes as STRING and again failing to export due to datatype mismatch.
Major Issue : If there is a mismatch in the Excel Sheet at nth row, Export stops at the nth row开发者_开发知识库. Still, we get the output as Package Successful. How to fix the datatype mismatch of Excel Data Export to SQL Database ?
You could approach it slightly differently as follows: read the excel spreadsheet in directly to one or more staging table(s) but force all columns to be VARCHAR/NVARCHAR columns. This will then enable you to read all rows into SQL without errors. Then create a second DFT to read from the staging table(s) into your correctly defined table(s)(correctly defined in terms of field type/size). You can build error logging into the second DFT to pump erroneous rows into an error table for later attention.
精彩评论