Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2004
    Posts
    34

    Unanswered: Text local variable

    Hi All,

    How to declare TEXT datatype as local variable . My data is getting truncated as it cross varchar(8000) characters.

    Saju

  2. #2
    Join Date
    Mar 2005
    Location
    Netherlands
    Posts
    280
    Assuming SQL 2000: You can't! TEXT and IMAGE are datat types that you can't assign to local variables.

    When needed I create a temp table with 1 column of type text:
    Code:
    CREATE TABLE #tkst (kol TEXT)
    -- INSERT an empty string
    INSERT #tkst VALUES('')
    -- Get the textpointer which is usable throughout the script
    SELECT @ptrval = TEXTPTR(kol) 
    FROM #tkst
    Ofcourse you will have to use the WRITETEXT and UPDATETEXT functions to use this field. And beware that functions like SUBSTRING will only work on the first 8000 characters in the column.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •