dbTalk Databases Forums  

Import Truncation Error - Please help

microsoft.public.sqlserver.tools microsoft.public.sqlserver.tools


Discuss Import Truncation Error - Please help in the microsoft.public.sqlserver.tools forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Craig
 
Posts: n/a

Default Import Truncation Error - Please help - 09-11-2009 , 12:15 AM






Hello. I'm using SQL 2008.

I am at my wit's end. All I'm trying to do is import data into a SQL table.
No matter what data type I try (varchar, nvarchar(max), ntext) it's no use.
I get the same truncation errors and the import halts.

I've tried importing from Excel, text, Access. No use. Am I to assume that
if you have a field that just happens (God forbid) to be over 255 characters,
you're up the creek?

I've tried creating my own table and importing into it - nothing.

I've searched this site and I can't get find any solution. Somebody please
help.

Thank you.
--
Craig

Reply With Quote
  #2  
Old   
Craig
 
Posts: n/a

Default RE: Import Truncation Error - Please help - 09-11-2009 , 02:10 AM






sUPDATE:

Don't mind me replying to myself...

It's a little odd that SQL 2008 doesn't recognize Access 2007 databases. I
had to export to a text file, import into a 2003 mdb, then import into SQL.
SQL didn't like the actual delimited text file, Access 2007, or Excel 2007.

I was also told that you can set the field length on the fly as you import.
Any ideas on this?

Thanks for any and all help.
--
Craig


"Craig" wrote:

Quote:
Hello. I'm using SQL 2008.

I am at my wit's end. All I'm trying to do is import data into a SQL table.
No matter what data type I try (varchar, nvarchar(max), ntext) it's no use.
I get the same truncation errors and the import halts.

I've tried importing from Excel, text, Access. No use. Am I to assume that
if you have a field that just happens (God forbid) to be over 255 characters,
you're up the creek?

I've tried creating my own table and importing into it - nothing.

I've searched this site and I can't get find any solution. Somebody please
help.

Thank you.
--
Craig

Reply With Quote
  #3  
Old   
Linchi Shea
 
Posts: n/a

Default RE: Import Truncation Error - Please help - 09-11-2009 , 11:52 AM



It would help if you could be a bit more specific. I've been using the
import/export feature for quite some time, and it generally works fine.
Although it may not handle the true CSV format well, it doesn't just
arbitrarily truncate data if your data stay within the bound.

It sounds like it doesn't work for you at all. If that's the case, there
must be something else going on.

Linchi

"Craig" wrote:

Quote:
sUPDATE:

Don't mind me replying to myself...

It's a little odd that SQL 2008 doesn't recognize Access 2007 databases. I
had to export to a text file, import into a 2003 mdb, then import into SQL.
SQL didn't like the actual delimited text file, Access 2007, or Excel 2007.

I was also told that you can set the field length on the fly as you import.
Any ideas on this?

Thanks for any and all help.
--
Craig


"Craig" wrote:

Hello. I'm using SQL 2008.

I am at my wit's end. All I'm trying to do is import data into a SQL table.
No matter what data type I try (varchar, nvarchar(max), ntext) it's no use.
I get the same truncation errors and the import halts.

I've tried importing from Excel, text, Access. No use. Am I to assume that
if you have a field that just happens (God forbid) to be over 255 characters,
you're up the creek?

I've tried creating my own table and importing into it - nothing.

I've searched this site and I can't get find any solution. Somebody please
help.

Thank you.
--
Craig

Reply With Quote
  #4  
Old   
Craig
 
Posts: n/a

Default RE: Import Truncation Error - Please help - 09-11-2009 , 12:50 PM



Thanks for the response:

I get the following errors when importing a .txt/.xls file:

************************************************** ********
Error 0xc02020a1: Data Flow Task 1: Data conversion failed. The data
conversion for column "ToNEW" 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 "output column "ToNEW" (22)" failed
because truncation occurred, and the truncation row disposition on "output
column "ToNEW" (22)" 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 1: An error occurred while processing file
"C:\Documents and Settings\[redacted]\Desktop\[redacted]\tblResults1.txt" on
data row 17.
(SQL Server Import and Export Wizard)

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

Sorry for the length - I just copied the error message report.

Now, this happens when I create a table and then import into it, as well.

--
Craig


"Linchi Shea" wrote:

Quote:
It would help if you could be a bit more specific. I've been using the
import/export feature for quite some time, and it generally works fine.
Although it may not handle the true CSV format well, it doesn't just
arbitrarily truncate data if your data stay within the bound.

It sounds like it doesn't work for you at all. If that's the case, there
must be something else going on.

Linchi

"Craig" wrote:

sUPDATE:

Don't mind me replying to myself...

It's a little odd that SQL 2008 doesn't recognize Access 2007 databases. I
had to export to a text file, import into a 2003 mdb, then import into SQL.
SQL didn't like the actual delimited text file, Access 2007, or Excel 2007.

I was also told that you can set the field length on the fly as you import.
Any ideas on this?

Thanks for any and all help.
--
Craig


"Craig" wrote:

Hello. I'm using SQL 2008.

I am at my wit's end. All I'm trying to do is import data into a SQL table.
No matter what data type I try (varchar, nvarchar(max), ntext) it's no use.
I get the same truncation errors and the import halts.

I've tried importing from Excel, text, Access. No use. Am I to assume that
if you have a field that just happens (God forbid) to be over 255 characters,
you're up the creek?

I've tried creating my own table and importing into it - nothing.

I've searched this site and I can't get find any solution. Somebody please
help.

Thank you.
--
Craig

Reply With Quote
  #5  
Old   
Linchi Shea
 
Posts: n/a

Default RE: Import Truncation Error - Please help - 09-11-2009 , 02:03 PM



Can you save your text file in the ASCII format, make sure the column
separators and the row terminators are properly in place, and try to import
the text data into a table using BCP, just o make sure the fundamental pieces
are there and working? Then, we can move on to test import wizrad.

Linchi

"Craig" wrote:

Quote:
Thanks for the response:

I get the following errors when importing a .txt/.xls file:

************************************************** ********
Error 0xc02020a1: Data Flow Task 1: Data conversion failed. The data
conversion for column "ToNEW" 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 "output column "ToNEW" (22)" failed
because truncation occurred, and the truncation row disposition on "output
column "ToNEW" (22)" 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 1: An error occurred while processing file
"C:\Documents and Settings\[redacted]\Desktop\[redacted]\tblResults1.txt" on
data row 17.
(SQL Server Import and Export Wizard)

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

Sorry for the length - I just copied the error message report.

Now, this happens when I create a table and then import into it, as well.

--
Craig


"Linchi Shea" wrote:

It would help if you could be a bit more specific. I've been using the
import/export feature for quite some time, and it generally works fine.
Although it may not handle the true CSV format well, it doesn't just
arbitrarily truncate data if your data stay within the bound.

It sounds like it doesn't work for you at all. If that's the case, there
must be something else going on.

Linchi

"Craig" wrote:

sUPDATE:

Don't mind me replying to myself...

It's a little odd that SQL 2008 doesn't recognize Access 2007 databases. I
had to export to a text file, import into a 2003 mdb, then import into SQL.
SQL didn't like the actual delimited text file, Access 2007, or Excel 2007.

I was also told that you can set the field length on the fly as you import.
Any ideas on this?

Thanks for any and all help.
--
Craig


"Craig" wrote:

Hello. I'm using SQL 2008.

I am at my wit's end. All I'm trying to do is import data into a SQL table.
No matter what data type I try (varchar, nvarchar(max), ntext) it's no use.
I get the same truncation errors and the import halts.

I've tried importing from Excel, text, Access. No use. Am I to assume that
if you have a field that just happens (God forbid) to be over 255 characters,
you're up the creek?

I've tried creating my own table and importing into it - nothing.

I've searched this site and I can't get find any solution. Somebody please
help.

Thank you.
--
Craig

Reply With Quote
  #6  
Old   
Craig
 
Posts: n/a

Default RE: Import Truncation Error - Please help - 09-11-2009 , 07:21 PM



Haven't used BCP. I must be doing something wrong, this doesn't work
(incorrect syntax):

BCP xxxxxxx.dbo.tblresults in C:\Documents and
Settings\xxxxxxxx\Desktop\LawHI\test1.txt -T -c


--
Craig


"Linchi Shea" wrote:

Quote:
Can you save your text file in the ASCII format, make sure the column
separators and the row terminators are properly in place, and try to import
the text data into a table using BCP, just o make sure the fundamental pieces
are there and working? Then, we can move on to test import wizrad.

Linchi

"Craig" wrote:

Thanks for the response:

I get the following errors when importing a .txt/.xls file:

************************************************** ********
Error 0xc02020a1: Data Flow Task 1: Data conversion failed. The data
conversion for column "ToNEW" 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 "output column "ToNEW" (22)" failed
because truncation occurred, and the truncation row disposition on "output
column "ToNEW" (22)" 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 1: An error occurred while processing file
"C:\Documents and Settings\[redacted]\Desktop\[redacted]\tblResults1.txt" on
data row 17.
(SQL Server Import and Export Wizard)

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

Sorry for the length - I just copied the error message report.

Now, this happens when I create a table and then import into it, as well.

--
Craig


"Linchi Shea" wrote:

It would help if you could be a bit more specific. I've been using the
import/export feature for quite some time, and it generally works fine.
Although it may not handle the true CSV format well, it doesn't just
arbitrarily truncate data if your data stay within the bound.

It sounds like it doesn't work for you at all. If that's the case, there
must be something else going on.

Linchi

"Craig" wrote:

sUPDATE:

Don't mind me replying to myself...

It's a little odd that SQL 2008 doesn't recognize Access 2007 databases. I
had to export to a text file, import into a 2003 mdb, then import into SQL.
SQL didn't like the actual delimited text file, Access 2007, or Excel 2007.

I was also told that you can set the field length on the fly as you import.
Any ideas on this?

Thanks for any and all help.
--
Craig


"Craig" wrote:

Hello. I'm using SQL 2008.

I am at my wit's end. All I'm trying to do is import data into a SQL table.
No matter what data type I try (varchar, nvarchar(max), ntext) it's no use.
I get the same truncation errors and the import halts.

I've tried importing from Excel, text, Access. No use. Am I to assume that
if you have a field that just happens (God forbid) to be over 255 characters,
you're up the creek?

I've tried creating my own table and importing into it - nothing.

I've searched this site and I can't get find any solution. Somebody please
help.

Thank you.
--
Craig

Reply With Quote
  #7  
Old   
Erland Sommarskog
 
Posts: n/a

Default RE: Import Truncation Error - Please help - 09-12-2009 , 04:34 AM



Craig (Craig (AT) discussions (DOT) microsoft.com) writes:
Quote:
Haven't used BCP. I must be doing something wrong, this doesn't work
(incorrect syntax):

BCP xxxxxxx.dbo.tblresults in C:\Documents and
Settings\xxxxxxxx\Desktop\LawHI\test1.txt -T -c
You must put the file path in quotes, as always when specifying a file
path on the command line.



--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinf...ons/books.mspx

Reply With Quote
  #8  
Old   
Linchi Shea
 
Posts: n/a

Default RE: Import Truncation Error - Please help - 09-13-2009 , 10:37 PM



Oh, how much I love embedded space in a file path! :-(

Linchi

"Erland Sommarskog" wrote:

Quote:
Craig (Craig (AT) discussions (DOT) microsoft.com) writes:
Haven't used BCP. I must be doing something wrong, this doesn't work
(incorrect syntax):

BCP xxxxxxx.dbo.tblresults in C:\Documents and
Settings\xxxxxxxx\Desktop\LawHI\test1.txt -T -c

You must put the file path in quotes, as always when specifying a file
path on the command line.



--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinf...ons/books.mspx


Reply With Quote
  #9  
Old   
Craig
 
Posts: n/a

Default RE: Import Truncation Error - Please help - 09-14-2009 , 02:17 PM



I encountered errors with bcp (server connection not available).

I also tried BULK INSERT and received the error code 5 (access is denied).

I can access these drives through explorer. Any ideas?

Thanks.
--
Craig


"Linchi Shea" wrote:

Quote:
Oh, how much I love embedded space in a file path! :-(

Linchi

"Erland Sommarskog" wrote:

Craig (Craig (AT) discussions (DOT) microsoft.com) writes:
Haven't used BCP. I must be doing something wrong, this doesn't work
(incorrect syntax):

BCP xxxxxxx.dbo.tblresults in C:\Documents and
Settings\xxxxxxxx\Desktop\LawHI\test1.txt -T -c

You must put the file path in quotes, as always when specifying a file
path on the command line.



--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinf...ons/books.mspx


Reply With Quote
  #10  
Old   
Erland Sommarskog
 
Posts: n/a

Default RE: Import Truncation Error - Please help - 09-14-2009 , 04:39 PM



Craig (Craig (AT) discussions (DOT) microsoft.com) writes:
Quote:
I encountered errors with bcp (server connection not available).
Did you specify the server correctly? You do this with the -S option.
If you leave it out, it will try connect to the local default instance.

Quote:
I also tried BULK INSERT and received the error code 5 (access is denied).

I can access these drives through explorer. Any ideas?
It could be that the service account for SQL Server does not have access
to these disks. What machine is SQL Server running on, and which is the
service account? It usually best to have a regular user account, and
not LocalSystem or somesuch.


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinf...ons/books.mspx

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.