December 5, 2011 at 1:13 pm
I'm trying to import data from a .csv file into a table and it consistently imports 2033 less rows than the total in the file. I've manipulated the number of records in the file, and it's consistently 2033 less than the total. The import is successful, just not all the rows are imported.
I did test importing a different set of data into a different table in the same database, and it successfully imported all the records. So it appears to be an issue with this particular table and not the database.
Has anyone seen anything like this?
Kevin
December 5, 2011 at 1:30 pm
how are you importing? SSIS? BULK INSERT? are you importing to a staging table first?
I'm sure there's an explanation, we just gotta dig a little bit.
Lowell
December 5, 2011 at 1:48 pm
Using Import/Export Wizard. This is a test database. Taking it straight to the table. I did drop and recreate the table. Same thing. I can try creating a staging table.
December 5, 2011 at 2:14 pm
Is it possible you have some data problems in the csv? For example, in the column mapping of the wizard, are there more columns than there should be?
Thanks,
Jared
Jared
CE - Microsoft
December 5, 2011 at 2:32 pm
Pretty sure I checked thoroughly and it looks clean. The last column did contain data with commas, and the delimiter was a comma. I requested they send a data file using pipes, which cleaned that up. But still same problem.
I will double check that file again. There has to be something I overlooked.
December 5, 2011 at 3:18 pm
Kevin Drysdale (12/5/2011)
Pretty sure I checked thoroughly and it looks clean. The last column did contain data with commas, and the delimiter was a comma. I requested they send a data file using pipes, which cleaned that up. But still same problem.I will double check that file again. There has to be something I overlooked.
Might I suggest that you look for values that are not supported by MS, such as:
1. Start of heading a hx 1 Oct 1
2. Start of text 2 2
3. End of text 4 4
For a comprehensive list of these types of characters go to:
And at that site in the main task bar click on ASCII (left most item on the task bar).
December 5, 2011 at 9:16 pm
use ssis package for loading .csv file that time you find out what is excact issue in .csv file.
December 5, 2011 at 9:40 pm
Kevin Drysdale (12/5/2011)
I'm trying to import data from a .csv file into a table and it consistently imports 2033 less rows than the total in the file. I've manipulated the number of records in the file, and it's consistently 2033 less than the total. The import is successful, just not all the rows are imported.I did test importing a different set of data into a different table in the same database, and it successfully imported all the records. So it appears to be an issue with this particular table and not the database.
Has anyone seen anything like this?
Kevin
Have you tried using BCP utility ? Are you getting the same result with that also ?
December 5, 2011 at 10:43 pm
Why not delete the table and recreate it.
December 5, 2011 at 11:37 pm
texpic (12/5/2011)
Why not delete the table and recreate it.
Using Import/Export Wizard. This is a test database. Taking it straight to the table. I did drop and recreate the table. Same thing. I can try creating a staging table.
He has already tried that.
December 6, 2011 at 5:27 am
Kevin Drysdale (12/5/2011)
Using Import/Export Wizard. This is a test database. Taking it straight to the table. I did drop and recreate the table. Same thing. I can try creating a staging table.
If you have option go for SSIS...By following steps:
Open BIDS
1. Drag Data Flow Task on the Control Flow tab.
2. Double click on the Data Flow Task.
3. Drag Flat File Source on the Data Flow tab.
4. Double click on it.
5. Click on New button and add connection to .csv file.
6. Click on Columns list box item and select columns from the table.
7. Click on OK button.
8. Drag OLE DB Destination on the Data Flow tab.
9. Drag green arrow from it on the OLE DB Destination component.
10. Double click on it.
11. Click on new button and select destination Table to create.
12. Click on mappings list box item and select column mappings between .csv columns file and database columns.
13. Click on Control Flow tab.
14. press F5 and check the new table is crated are not....
Need help? Help us help you.
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply