• Gotta' admit, I prefer working in SQL/TSQL, so even for (moderately) large text files I'll often just do an:

    OPENROWSET(BULK '<path_and_file_name>', SINGLE_CLOB) --or NCLOB, if req'd

    to load the whole file at once into a [n]varchar(max) variable or table column, then process it from there. Maybe that can be of some help in your case as well.

    [IIRC, that method doesn't optimize logging, so you might want to use a temp table when possible, or always if the file is very large.]

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.