ntext data type invalid for local variables

  • I get the following error:

    "The text, ntext, and image data types are invalid for local variables."

    It speaks for itself, so i know what the problem is, but how can i work around it.

    I am writing a script to merge 2 common tables, and i need those columns in the new table (there are 2 ntext columns).

    Any help or suggestions are always appreciated.

    Thanks,

    Ryan

  • Hi Ryan,

    quote:


    I am writing a script to merge 2 common tables, and i need those columns in the new table (there are 2 ntext columns).

    Any help or suggestions are always appreciated.


    if the 2 ntext columns do not exceed 8,000 characters, maybe you can fetch those two column into varchar(8000) variables and insert them.

    However, if they do exceed 8,000 characters, you might take a look at TEXTPTR. It should do this, but I'm not familiar with it.

    Surely someone out there is

    Cheers,

    Frank

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • Thanks for you help Frank.

    I considered that, but i couldn't determine how long data in those columns are.

    I tried doing a LEN(column_name) > 8000 Query, but i got an error similar to the error in my 1st post.

    Do you know another way to determine the length?

    Anyway, I don't think that they exceed 8000 characters, so I will probably just go that route.

    Thanks again,

    Ryan

  • quote:


    Thanks for you help Frank.

    I considered that, but i couldn't determine how long data in those columns are.

    I tried doing a LEN(column_name) > 8000 Query, but i got an error similar to the error in my 1st post.

    Do you know another way to determine the length?

    Anyway, I don't think that they exceed 8000 characters, so I will probably just go that route.


    use DATALENGTH(column).

    I spent the whole morning with this exciting task

    Cheers,

    Frank

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

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

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