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
 General SQL Server Forums
 New to SQL Server Programming
 Ignore rows with errors during import?

Author  Topic 

kspence
Starting Member

5 Posts

Posted - 2010-03-18 : 17:52:55
I'm slowly learning SQL, and I've recently run into a problem that I'm hoping you can help me with.

I have a CSV file that I need to import into a table in my database. The problem is that it's about 75k rows, and probably 300 of those rows have errors in them (ie: an extra comma).

I'm using the import function in phpmyadmin, and it works fine until I hit a row with an extra comma in it (it's a comma delimited CSV, so the extra comma makes it look like I'm trying to insert an extra field). At this point, the process errors out and the import stops.

What do you think would be the best way to handle this?

edit: this is a product feed that I have no control over -- I'd address the data entry aspect/error handling on that front if I could:)

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-03-18 : 18:02:10
phpmyadmin isn't a Microsoft SQL Server product. SQLTeam.com is for Microsoft SQL Server.

You'll have better luck regarding your php problem on a site that deals with php.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-03-18 : 18:05:58
Try the forums over at dbforums.com, they may be able to help you out over there.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -