Text Export

  • I need to add dbl quotes around the beggining and end of the data in a text data-type column.

    There are lot of string functions to do this, but the data in the text exceeds the max capcity when I convert, therfore truncating some of the data.

    Any suggestions?

    -JG


    -JG

  • How are you try to export, BCP, DTS some other. With the BCP and DTS you can specific " as a delimiter for each column of data and it shoudl not truncate. Or are you try to do something I don't understand from your thread title.

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

  • here's something

    DECLARE @StrLen int

    DECLARE @ptr binary(16)

    CREATE TABLE #TEST

    (

    cnt int ,

    textstr text

    )

    INSERT INTO #TEST

    VALUES (1,REPLICATE('AB',10))

    SELECT *

    FROM #TEST

    SELECT @Ptr = TEXTPTR (textstr)

    FROM #TEST

    WHERE cnt = 1

    UPDATETEXT #TEST.textstr @Ptr 0 0 '"'

    SELECT @StrLen = DATALENGTH(textstr)

    FROM #TEST

    WHERE cnt = 1

    UPDATETEXT #TEST.textstr @Ptr @Strlen 0 '"'

    SELECT *

    FROM #TEST

    DROP TABLE #TEST

    u'd have to do this in a loop for each row ...

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

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