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.
| Author |
Topic |
|
MaverickUK
Yak Posting Veteran
89 Posts |
Posted - 2003-11-25 : 06:49:29
|
Hey guysI'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 columnDECLARE @ptrval binary(16)SELECT @ptrval = TEXTPTR( PublicText ) FROM ItemsWHERE ItemID = @ItemIDWRITETEXT 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.PublicTextFROM Items I INNER JOIN LimboItems L ON I.ItemID=@ItemID AND L.EditItemID=@EditItemID |
 |
|
|
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 ;) |
 |
|
|
|
|
|