Unix Technical Forum

Too many columns found in the current row; non-whitespace characters were found after the last defined column's data.

This is a discussion on Too many columns found in the current row; non-whitespace characters were found after the last defined column's data. within the SQL Server Data Warehousing forums, part of the Microsoft SQL Server category; --> ERROR "Too many columns found in the current row; non-whitespace characters were found after the last defined column's data." ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server Data Warehousing

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 06:55 PM
lbunet@yahoo.com
 
Posts: n/a
Default Too many columns found in the current row; non-whitespace characters were found after the last defined column's data.

ERROR
"Too many columns found in the current row; non-whitespace characters
were found after the last defined column's data."

SOLUTION
Try changing the "Row delimiter" field from {CR}{LF} to {CR} within the
"Select file format" dialog of DTS Import Data wizard (it's the 3rd
dialog of the Wizard).

REASON
I believe it has to do with the way a line of text is terminated under
UNIX vs. Windows because everytime I've encountered this error it was
while importing a text file downloaded from a UNIX FTP site.

LB
"Do not attempt to be all things to all people. Unless, of course,
you'd like to live your life burnt out, exhausted, and unappreciated."

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 06:55 PM
steven_kielkucki@harte-hanks.com
 
Posts: n/a
Default Re: Too many columns found in the current row; non-whitespace characters were found after the last defined column's data.

After researching this a little further, it appears that the DTS can be
told to expect any number of columns in the import file provided that
there is a row with the max number of columns found in the first 2mb of
data. Microsoft doesn't consider it a bug but it is. Here are the
details:

1) Import file greater than 2mb w/ varying number of columns in rows
based on delimiter

2) DTS configured to import specific number of columns from each row
that is a subset of the average number of columns (i.e. Load first 12
columns of data for each row that averages 15 columns)

3) First 2mb of file contains rows with a maximum number of columns
less than the maximum number of columns in rows found in data after the
first 2mb (i.e. Max rows in first 2mb might be 15; a few rows after the
first 2mb may have more columns than the average number of 15 and each
of them will return the same error).

Note: The number of columns is not specific to the problem and they are
only provided to help clarify.


Fix:
Ensure a row containing the maximum number of columns exists in the
first 2mb of data.

This can be accomplished (for example) through the use of a
temporary/load table containing one column. The table can be loaded
with all the rows and a query run against it to determine the maximum
number of column delimiters. Take the max number of delimiters and
subtract it from the number of delimiters in the first row. Add that
number of delimiters to the end of the data in the first row.

This is not the only solution...just an example of how to work around
the problem. Other examples would be welcomed posts.



lbunet@yahoo.com wrote:
> ERROR
> "Too many columns found in the current row; non-whitespace characters
> were found after the last defined column's data."
>
> SOLUTION
> Try changing the "Row delimiter" field from {CR}{LF} to {CR} within the
> "Select file format" dialog of DTS Import Data wizard (it's the 3rd
> dialog of the Wizard).
>
> REASON
> I believe it has to do with the way a line of text is terminated under
> UNIX vs. Windows because everytime I've encountered this error it was
> while importing a text file downloaded from a UNIX FTP site.
>
> LB
> "Do not attempt to be all things to all people. Unless, of course,
> you'd like to live your life burnt out, exhausted, and unappreciated."


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:24 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com