DTS import text file using unusual delimiters

  • I created a couple of VB applications which allows me to create packages which can export SQL Server tables to text files and can import into SQL Server tables from text files. 

    I came across a couple of tables which had commas and {CR}{LF} characters in the data.  This prompted me to change the column and row delimiters to something that I thought our users (which are all in the US) would never input.  Ÿ is now my column delimiter and š is now my row delimiter. 

    I also stopped using a text qualifier, since I noticed that when I used them NULL values in any of the varchar datatype fields would be converted to empty strings when imported. 

    Now the problem is that when I import a table whose last column field value is NULL for the last row, the DTS package wants to assign the value of my row delimiter (š) to that field.  The row delimiter is the last character in my text file.  This is the intended functionality I assume.  I've tried deleting the last row delimiter.  But then the last row doesn't get imported at all.

    How do I get DTS to see that the last row delimiter is not part of the data when the field value for the last row is NULL? 

    Since I posted this, I haven't seen many views much less a reponse.  Am I not being specific enough about what the problem is? 

  • This is somewhat of a Hack of an answer, but if the problem is NULLs in the last Field, How about in your select statement, Adding and extra column that you ignore on the other end.  soemthing like

    SELECT Col1Col2Col3'Lastcol' AS lastcolumn

    FROM MyTable  

    That way you'll never have a NULL in that last column. 

    To help us help you read this[/url]For better help with performance problems please read this[/url]

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply