The question related to WRITETEXT and UPDATETEXT, I want to update the content from old db to new db.

  • I want to used the below query to transfer the data from old db to new db. But it's failed.

    -- The below doesn't work. (content is blank)

    use newdb

    DECLARE @val BINARY(16)

    SELECT @val=TEXTPTR([Content]) FROM [olddb].dbo.[ta_news]

    WHERE 1=1

    AND [Id] IN (100000000795)

    ORDER BY [Id]

    WRITETEXT [ta_news].[Content] @val (SELECT [Content] FROM [olddb].dbo.[ta_news] WHERE [Id] IN (100000000795))

    -- The below can let me to write the data successfully. But it's not my purpose. 🙁

    WRITETEXT [ta_news].[Content] @val N'new content'

    So does anybody can give suggestion on this? So that I can transfer the data from old db to new db.

    Thanks,

    Benny Ng

  • Have you tried

    INSERT INTO [newdb].dbo.[ta_news]

    SELECT [ID], [Content] FROM [olddb].dbo.[ta_news] WHERE [Id] = 100000000795



    Shamless self promotion - read my blog http://sirsql.net

  • Nicholas Cain (12/27/2008)


    Have you tried

    INSERT INTO [newdb].dbo.[ta_news]

    SELECT [ID], [Content] FROM [olddb].dbo.[ta_news] WHERE [Id] = 100000000795

    But this is not supported the nText data type.

    The content after 4000 chars will be cut. 🙁

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

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