Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 The WRITETEXT blues

Author  Topic 

MaverickUK
Yak Posting Veteran

89 Posts

Posted - 2003-11-25 : 06:49:29
Hey guys

I'm attempting to update a TEXT column in one table, from another TEXT column in another table. However, I'm having real problems getting this to work.
Here's my syntax as it stands.


-- Update the text column
DECLARE @ptrval binary(16)
SELECT @ptrval = TEXTPTR( PublicText )
FROM Items
WHERE ItemID = @ItemID

WRITETEXT Items.PublicText @ptrval ( SELECT PulicText FROM LimboItems WHERE EditItemID = @EditItemID )


The WRITETEXT line won't work as it doesn't like the subSelect I'm doing.
But as you can't create a TEXT variable in T-SQL to hold to data you wish to update with, I'm not sure how to procedue.

Please help chaps!

robvolk
Most Valuable Yak

15732 Posts

Posted - 2003-11-25 : 07:57:54
Did you try:

UPDATE I SET PublicText=L.PublicText
FROM Items I INNER JOIN LimboItems L
ON I.ItemID=@ItemID AND L.EditItemID=@EditItemID
Go to Top of Page

MaverickUK
Yak Posting Veteran

89 Posts

Posted - 2003-11-25 : 08:05:34
Doh, of course :)

Thanks RobV, this cold is effecting my SQL powers ;)
Go to Top of Page
   

- Advertisement -