• elee1969 (7/17/2013)


    sdevanny (7/17/2013)


    If you used my suggestion with a dervied column, you might want to double check and make sure that you have a correct count of delimiters and columns now. I believe that my suggestion will actually add one extra delimiter - sorry I missed that when originally replied.

    i checked and you are correct. I get this now:

    partnerkey|first_name|middle_name|last_name|email||

    12345|David|jones|jones |jones@email.com||

    How do i fix this?

    Thanks!

    Any of these methods will do the job...

    DECLARE @STR AS VARCHAR(500)

    SET @STR = 'partnerkey|first_name|middle_name|last_name|email||'

    SET @STR = REPLACE(@str,'||','|')

    SELECT @STR

    SET @STR = 'partnerkey|first_name|middle_name|last_name|email||'

    SET @STR = LEFT(@str,LEN(@str)-1)

    SELECT @STR

    SET @STR = 'partnerkey|first_name|middle_name|last_name|email||'

    SET @STR = REVERSE(STUFF(REVERSE(@str),1,1,''))

    SELECT @STR