Copying NTEXT data from one record to another

  • I tried seaching the archive without much success, so here is my situation.

    I have a SS2K database.

    I have a table with one NTEXT field. The table has a prime key and I need to copy data from that field in one record to another record.

    I tried using:

    UPDATE MyTable

    SET MyNtext = (SELECT MyNtext FROM MyTable WHERE PK = 44)

    WHERE PK = 66

    I get the error code:

    .Net SqlClient Dataq Provider: Msg 279, Level 16, State 3, Line 40

    The ntext data type is invalid in the subqquery or aggregate expression.

    I started playing around with READTEXT and WRITETEXT, but I don't know how to get the output from the READTEXT to feed the input of the WRITETEXT.

    Does anyone have an example of how to do this? Any help would be appreciated!

  • I'm a rank beginner (been working with T-SQL for a couple of weeks!) but I found this page which seems to indicate that you can't treat nText like other "smaller" types of variables. Instead it seems you have to use pointers to retrieve the data.

    http://msdn.microsoft.com/en-us/library/aa175795%28SQL.80%29.aspx

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

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