March 2, 2011 at 6:18 am
Im trying to upload a txt file with muliple rows into a table with a single field (char(8000)) biggest in sql2005...
The problem Im getting is that the bulk insert process errors out if my txt file has a row bigger than 8000 characters.
Im using the Rowterminator '/n'
I need the bulk insert process to just jump to the next line when the 8000 characters have been hit and ignore the rest of the charcters.
Any help would be much apreciated.
March 2, 2011 at 7:15 am
What are you using to bulk insert the data.
One solution (and there will probably be more) is the following:
use SSIS with a .NET script task (or just build a .net application, whatever suits you) and stream the file into memory. There you can specify that you only want to read the first 8000 characters. Store the results in a datatable and bulk copy it into sql server using the sqlbulkcopy class.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply