Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

The question related to WRITETEXT and UPDATETEXT, I want to update the content from old db to new db. Expand / Collapse
Author
Message
Posted Saturday, December 27, 2008 4:27 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Sunday, April 8, 2012 9:24 PM
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.
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
Post #626214
Posted Saturday, December 27, 2008 5:21 PM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, October 28, 2014 12:11 PM
Points: 2,006, Visits: 6,081
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
Post #626218
Posted Sunday, December 28, 2008 3:10 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Sunday, April 8, 2012 9:24 PM
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.
Post #626352
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse