Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2002
    Posts
    5

    Unhappy Unanswered: How to select TEXT columns.

    I have a TEXT column (more then 15.000 chracters in my cell) and I need to select all characters into a TEXT local variables . How ?

    My case :

    CREATE PROCEDURE TEST
    @VARTEXT TEXT
    AS
    SELECT @VARTEXT = MY_TEXT_COLUMN
    FROM MYTABLES
    WHERE ID = ...

    EXECUTE(@VARTEXT)


    But does not work : Server: Msg 409, The assignment operator operation cannot take a text data type as an argument.
    Last edited by balaurul; 12-16-02 at 21:14.

  2. #2
    Join Date
    Dec 2002
    Location
    Czech Republic
    Posts
    249
    Use table variable or temporary table

    if object_id('tempdb..#Blob') is not null drop table #Blob
    GO
    create table #Blob (Blob ntext not null)
    GO
    insert #Blob(Blob) select REPLICATE('A',16000)
    declare @t table (Blob ntext not null)
    insert @t(Blob)
    select Blob from #Blob
    select datalength(Blob) from #Blob
    select datalength(Blob) from @t

Posting Permissions

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