SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


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


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

Author
Message
miaomiaoga
miaomiaoga
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
Points: 2 Visits: 20
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. Sad
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
Nicholas Cain
Nicholas Cain
Hall of Fame
Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)

Group: General Forum Members
Points: 3098 Visits: 6200
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
miaomiaoga
miaomiaoga
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
Points: 2 Visits: 20
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. Sad
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search