I read a CSV file and use a string builder to compile a large string. I have used this for speed.
Once it has built the entire string of 60,000 rows, I write this to a file, I call, BULKLINES.sql
OK, I then have an sql stored procedure which is BULK INSERT, and points to that file. HERE is the wierd part.
When I execute the stored procedure on the file I created it errors, BUT if I open the file with notepad, CTRL-A select all and copy to a new file, lets say BULKLINES_COPY.sql and then run the stored procedure pointing at this copied file, it works great.
I cannot pinpoint the error as the two files are the same with regards to their contents. But yet it will onky work on the copy file.
Could I be writing the file wrong? I simply use a streamWriter and I have tried the WriteLine and Write Methods
Thanks in advance