March 1, 2004 at 4:05 pm
NEWBIE needs help
I'm trying to copy a ntext field from one table to another table. How can I do this? I have found several documents out there but they all reference how to get a varchar or text field or standard text into a ntext field, my dilema is I have 2 ntext fields in this equation. Here is the scenario:
table1.memo(ntext)
table2.notes(ntext)
I need to merge table2.notes into table1 based on table2.col1 equaling table1.col1, does anyone have any suggestions on doing this? I have tried converting table2.notes to varchar(8000) and inserting but that doesn't work. I believe the correct way to do this would be WRITETEXT, but can someone help. thanks, Brian
March 1, 2004 at 5:02 pm
if the ROW on the destination does not exists
then
INSERT INTO Table1 (fld1, fld2,.......,memo)
SELECT Table2.fld1,Table2.fld2, ..., Table2.notes
FROM Table2 left outer join Table1 on Table2.col1=Table1.col1
Where Table1.Col1 is Null
But if the destination exists
Then
Update Table1 Set Memo = Notes
FROm Table2
Where Table1.Col1 = Table2.col1
* Noel
March 4, 2004 at 8:00 pm
Thanks for the quick reply, that actually wasn't what I was looking for. For some reason when I tried pulling information from a ntext field and placing into another ntext field in another table, I was getting the same record in all the fields. I'm not sure what happened, but I eventually just did a convert(varchar(8000), table2.Memo) when updating table1 and it worked. thanks again for the response
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply