Author |
Topic |
rongrace
Starting Member
13 Posts |
Posted - 2011-12-16 : 02:09:24
|
I'm trying to import from delimited flat file that includes a header row. The header row is about 1050 characters, and the detail line 925 characters. As the fle is deleimted both rows have the same number of fields, but when I try to import using the wizard it errors.I select the data source as 'Flat File Source'. I locate the file, enter the 'Text Qualifier' and tick the 'Column names in the first data row' box, then run therough the next screens and Finish. The report showa all the data items as 50 character fields but on the last data item (QuoteNumber)I get the following[QuoteNumber" failed with the following error: "Incorrect syntax near 'QuoteNumber'.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly. (SQL Server Import and Export Wizard)I can only assume that it's expecting another 50 character field but the difference in length between the header and data rows is greater than 50 characters, an example is belowCompanyNo|AjKey|InvoiceNum|AjoCompanyNo|AjoLedger|AjoAcno|AjnCompanyNo|AjnLedger|AjnAcno|AjoAdrsNum|AjnAdrsNum|UnitCode|SaleUnit|AjoActivity|AjnActivity|QrefKey|QrefStatus|QrefOpno|AjoDelpntX|AjnDelpntX|AjoDlvrTo|AjnDelvrTo|AjoProdGrCode|AjnProdGrCode|AjoProdCode|AjnProdCode|AjoProdDesc|AjnProdDesc|AjoHaulier|AjnHaulier|AjoCustOrder|AjnCustOrder|EndUse|AddedVia|AjoTktmrkr2|AjoTktmrkr3|AjoTktmrkr4|AjoCollDelv|AjnTktmrkr2|AjnTktmrkr3|AjnTktmrkr4|AjnCollDelv|AjoTktQty|AjnTktQty|AjQtyDiff|AjoActualMiles|AjnActualMiles|AjoHlrRate|AjnHlrRate|AjHrateDiff|AjoActualShr|AjnActualShr|AjoActualPrice|AjnActualPrice|AjIrateDiff|AjoTktValue|AjnTktValue|AjValueDiff|TktVat|PeriodKey|WeekNum|AjoHlgeArea|AjnHlgeArea|TktDate|ZDocRef|SelfBillNo|SbiDate|AjInvoiceDate|AjoVatRate|AjnVatRate|AjStatus|QrOpno|AjLevel|AjWeek|AjPeriod|AjCurrent|AjUnit|AjManager|AjoInvno|AjnInvno|AjoHlrno|AjnHlrno|AjFlag1|AjFlag2|AjFlag3|AjFlag4|QueryNo|CreatedDate|TimeCreated|CreatedBy|ReasonCode|AjPostedDate|AjComment1|AjComment2|AjComment3|AjFao|AjoProdCat|AjnProdCat|QuoteNumber01|251497|783366|01|10|844865|01|10|844865|1 |1 |717 |CM|561 |561 | | | |SE605521|SE605521| | |PA|PA|PDES|PDES|C25/30 20 GRA CIIIA+ 10 S/D |C25/30 20 GRA CIIIA+ 10 S/D |017464|017464|. |041440629 |EU00|B|X|S|4|D|X|S|4|D|100 |100 |0 |8 |8 |12390 |12390 |0 |10200 |10200 |8820 |8820 |0 |8820 |8820 |0 |0 |20|25|71|71|20100615|921497|264501|20100619|20100619|1750 |1750 |C |JN01| |0 |0 | |BBY |1Q| | | | |Y|N|Y|N|658134|20111210|7535|VKE7|7A|0 |Cancelled In Full | | | |X | |JB994243 01|251496|783367|01|10|844865|01|10|844865|1 |1 |717 |CM|561 |561 | | | |SE605521|SE605521| | |XP|XP|XP01|XP01|PART LOAD CHARGE - Cubic Metres |PART LOAD CHARGE - Cubic Metres |017464|017464|. |0414 40629 |EU00|B|X|S|4|D|X|S|4|D|200 |200 |0 |8 |8 |12390 |12390 |0 |12390 |12390 |2000 |2000 |0 |4000 |4000 |0 |0 |20|25|71|71|20100615|921497|264501|20100619|20100619|1750 |1750 |C |JN01| |0 |0 | |BBY |1Q| | | | |Y|N|Y|N|658134|20111210|7522|VKE7|7A|0 |Cancelled In Full | | | |X | |JB994243 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-12-16 : 02:11:41
|
whats the row delimiter you chose?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
rongrace
Starting Member
13 Posts |
Posted - 2011-12-16 : 02:43:36
|
The pipe delimiter (|) |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-12-16 : 03:18:10
|
how can row delimiter be |? thats column delimiter. row delimiter should be CR LF------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
rongrace
Starting Member
13 Posts |
Posted - 2011-12-16 : 03:34:06
|
Apologies, the line deleimiter is CR/LF, but that shouldn't be a problem as I have another 20 or so files that were all created using a similar routine and they all load correctly. the only difference I can find is that the header row in this file is substantially larger than the data row |
|
|
rongrace
Starting Member
13 Posts |
Posted - 2011-12-19 : 04:28:48
|
I have rerun the data extract and the sql import and now I'm getting the followingOperation stopped...- Initializing Data Flow Task (Success)- Initializing Connections (Success)- Setting SQL Command (Success)- Setting Source Connection (Success)- Setting Destination Connection (Success)- Validating (Success)- Prepare for Execute (Success)- Pre-execute (Success) Messages * Information 0x402090dc: Data Flow Task: The processing of file "G:\rongrace\AjDetail.TXT" has started. (SQL Server Import and Export Wizard) - Executing (Error) Messages * Error 0xc02020a1: Data Flow Task: Data conversion failed. The data conversion for column "QuoteNumber " returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.". (SQL Server Import and Export Wizard) * Error 0xc020902a: Data Flow Task: The "output column "QuoteNumber " (402)" failed because truncation occurred, and the truncation row disposition on "output column "QuoteNumber " (402)" specifies failure on truncation. A truncation error occurred on the specified object of the specified component. (SQL Server Import and Export Wizard) * Error 0xc0202092: Data Flow Task: An error occurred while processing file "G:\rongrace\AjDetail.TXT" on data row 2. (SQL Server Import and Export Wizard) * Error 0xc0047038: Data Flow Task: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on component "Source - AjDetail_TXT" (1) returned error code 0xC0202092. The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing. There may be error messages posted before this with more information about the failure. (SQL Server Import and Export Wizard) * Error 0xc0047021: Data Flow Task: SSIS Error Code DTS_E_THREADFAILED. Thread "SourceThread0" has exited with error code 0xC0047038. There may be error messages posted before this with more information on why the thread has exited. (SQL Server Import and Export Wizard) * Error 0xc0047039: Data Flow Task: SSIS Error Code DTS_E_THREADCANCELLED. Thread "WorkThread0" received a shutdown signal and is terminating. The user requested a shutdown, or an error in another thread is causing the pipeline to shutdown. There may be error messages posted before this with more information on why the thread was cancelled. (SQL Server Import and Export Wizard) * Error 0xc0047021: Data Flow Task: SSIS Error Code DTS_E_THREADFAILED. Thread "WorkThread0" has exited with error code 0xC0047039. There may be error messages posted before this with more information on why the thread has exited. (SQL Server Import and Export Wizard) - Copying to [HP3000_Hanson].[dbo].[AjDetail] (Stopped)- Post-execute (Success) Messages * Information 0x402090dd: Data Flow Task: The processing of file "G:\rongrace\AjDetail.TXT" has ended. (SQL Server Import and Export Wizard) * Information 0x402090df: Data Flow Task: The final commit for the data insertion has started. (SQL Server Import and Export Wizard) * Information 0x402090e0: Data Flow Task: The final commit for the data insertion has ended. (SQL Server Import and Export Wizard) - Cleanup (Success) Messages * Information 0x4004300b: Data Flow Task: "component "Destination - AjDetail" (406)" wrote 0 rows. (SQL Server Import and Export Wizard) |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-12-19 : 04:40:50
|
seems like there's some conversion error happening. check the datatype of QuoteNumber and actual data coming in it------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
rongrace
Starting Member
13 Posts |
Posted - 2011-12-19 : 04:52:13
|
All the fields in the data file are extracted from the source system as character fields and imported in to the sql table as varchar50 fields |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-12-19 : 05:17:36
|
are there any values that cross 50 character limit coming for Quotenumber field?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
rongrace
Starting Member
13 Posts |
Posted - 2011-12-19 : 05:31:13
|
The field in the source system is only 10 characters and that's how it was extracted |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-12-19 : 06:40:59
|
quote: Originally posted by rongrace The field in the source system is only 10 characters and that's how it was extracted
my guess input data is having some invalid character in between causing it to wrongly interpret values for various fields and then causing large data to be associated with last field QuoteNumber causing this error.Can you save this as a package and open it in business intelligence development studio and see what all tasks it ha?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|