Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems Importing Data in SQL Server 7.0

Status
Not open for further replies.

dom24

Programmer
Aug 5, 2004
218
GB
HI,

I'm trying to import data into one of my tables from an excel spreadsheet. Each time I try to do so I get an error saying "Error at Destination for Row number 234. Errors encountered so far in this task:1"

Any ideas what the problem can be?
I've alraedy created my tables and added primary keys and relationships. I know that the import works without all teh relationships but I really don't want to have to delet them all and start again!

Thanks.

 
Look at the data in row 234 on the Excel sheet. The problem lies somewhere in there. If it works with the PK and FKs off then there is a relationship problem on that row.

Denny

--Anything is possible. All it takes is a little research. (Me)

[noevil]
 
I still can't get it to work.
There can't be a problem with the relationship asall i've got is a primary key called StaffNo and it relates to staffno in all the other tables. There are no other relationships in that table. Help!
 
Look at the data again in you Excel sheet. Make sure that the data in there is the same data type that it's trying to be inserted into in your SQL table. If it isn't you are going to error out! is there a ' (single quote) in there? extra comma if you're not using any text delimiters, etc.
 
Somewhere in row 234 there is something that it doesn't like. Either a duplicate key, or data that is to long for a field, or invalid characters going into a numeric field, text delimiter problem.

Denny

--Anything is possible. All it takes is a little research. (Me)

[noevil]
 
It's definitely not that data.
I found the problem is that it will import the data until the 2nd to last record. This suggests that there is some prolbem when it gets to the end of the file.
Is there some way of letting SQL server know that the last row of data is the end of file so stop there?
 
It sounds like the end of line character is missing for the last line. That will cause DTS to error out on the line. You'll need to fix the file before importing the data into SQL. That or if you know how many records there are to be imported you can tell DTS the last row to import in the transformation definations.

Denny

--Anything is possible. All it takes is a little research. (Me)

[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top