I recently wrote a program to move data from a CSV file into a SQL Server table using SqlBulkCopy.
The CSV file had data like
0,0,35.6,-122.5,1,
0,1,35.61188,-122.4438,1,
0,2,35.61979,-122.4062,1,
.
.
Below are some of my observations.
Trailing Delimiter Handling
With SqlBulkCopy, the data was successfully moved to SQL Server.
But when I used the SSIS Bulk Insert Task, the following error was reported
Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 1, column 5
Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 2, column 5
.
.
The fix for this was to remove the trailing ',' character at the end of each line in the CSV file as shown below and then perform SSIS Bulk Insert.
0,0,35.6,-122.5,1
0,1,35.61188,-122.4438,1
0,2,35.61979,-122.4062,1
.
.
Speed
I did not observe any significant difference in the data load speed of SqlBulkCopy & SSIS Bulk Insert task. I will post performance numbers at some later time.
Subscribe to:
Post Comments (Atom)
What is success?
The journey of life takes us through varied experiences like landing an admission at a prestigious college, earning a degree, getting hired,...
-
Recently after a domain password change, I got the following error in trying to run the webrole. Can not log on locally to WebRole as us...
-
I was trying my hands at creating a .NET 2.0 component that can be consumed by a COM application. One of the errors I got in the process of...
-
After editing the post-build event of my project in VS 2005, the following error came up "'Exec' task needs a command to execut...
No comments:
Post a Comment