0

I'm using postgresql (Pgadmin Version 1.18.0), i export three(I need only 3 tables) table(Contains Online Transaction information) data's into csv format using the query

copy to 'D:\orders\new\users.csv' DELIMITER ';' CSV HEADER

I got perfect result using the query. Now i open the ssms(Sql Server 2008) and using the Import and Export data option i import the users.csv file to sql server 2012 by using "Flat File Service Data Source". at last while i click the Finish Button it throws the following error Messages

--Error 0xc02020a1: Data Flow Task 1: Data conversion failed. The data conversion for 
column "address" 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 1: The "Source - users_csv.Outputs[Flat File Source 
Output].Columns[address]" failed because truncation occurred, and the truncation row 
disposition on "Source - users_csv.Outputs[Flat File Source Output].Columns[address]" 
specifies failure on truncation. A truncation error occurred on the specified object 
of the specified component.
 (SQL Server Import and Export Wizard)


--Error 0xc0047038: Data Flow Task 1: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.  The 
PrimeOutput method on Source - users_csv 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)

Please help me out. Sorry if it's vague.

Thanks in Anticipation.

Regards, Keerthi

2
  • 1
    What is your Postgres version? ("Pgadmin Version 1.18.0" is not the Postgres version, it is the pgAdmin version). Commented Jun 3, 2014 at 14:54
  • Yes, it's the pgadmin Version. Commented Jun 3, 2014 at 17:04

1 Answer 1

1

Your data's size exceeds the field size. Extend the size of your address field in the target table. If you still get the error, check the "Advanced" Option in the Import and Export Wizard. You can set the OutputColumnWidth for each column there.

Sign up to request clarification or add additional context in comments.

3 Comments

Hello Martin, As You suggested i tried in Advance option, but still got the same Error.. Warning 0x80049304: Data Flow Task 1: Warning: Could not open global shared memory to communicate with performance DLL; data flow performance counters are not available. To resolve, run this package as an administrator, or on the system's console. (SQL Server Import and Export Wizard)
.- Validating (Warning) Messages Warning 0x802092a7: Data Flow Task 1: Truncation may occur due to inserting data from data flow column "address" with a length of 500 to database column "address" with a length of 50. (SQL Server Import and Export Wizard) Warning 0x802092a7: Data Flow Task 1: Truncation may occur due to inserting data from data flow column "address" with a length of 500 to database column "address" with a length of 50. (SQL Server Import and Export Wizard)
Did you really change OutputColumnWidth? The second message still says that the address field in the database is 50 which is the default. From the second message you can see pretty good what your problem is: Your address field in the source file is 500 characters long while the database permits only 50.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.