Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 importing pipe delimited text file directly into SQL

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-10-25 : 08:52:19
Fran writes "I am trying to directly import a SQL data snapshot from a MLS provider into SQL 2000.

I have installed all the updates for the program but keep getting an error.

Here it is: Too many columns found in current row non whitespace characters were found after the last defined column data.
Context error Calling GetNextRow.

The weird thing is that I have no problem importing the data into Excel. You would think that SQL is more capable of importing the file so I am miffed. If I export the file as a Excel file and then import it into SQL No problems. It imports slick and sweet but I want to automate this import and no can do with the SQL error. I have checked the MS SQL site and they said to install the updates which I did to no avail. Still get the error.

Any help would be greatly appreciated. I am not an expert in SQL.

Thank you,"

Kristen
Test

22859 Posts

Posted - 2004-10-25 : 09:10:24
I would expect that Excel is silently ignoring the extra column, whereas SQL is [correctly IMHO] complaining about them. You might be able to use some formatting in Excel to discover which cells past the end of the visible data are actually "used" to track down the problem

Kristen
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2004-10-25 : 09:19:26
Have a look at the file and see if there are extra blank rows at the end of the file.
I would use bulk insert rather than dts to import (simpler and faster).

You can import into a single column staging table (most flexible and reliable) or use a command line command to get rid of extra lines before the import.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -