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 2005 Forums
 Transact-SQL (2005)
 Merging two data fields from same data table

Author  Topic 

Dejan
Starting Member

14 Posts

Posted - 2009-01-02 : 07:04:29
Hello,
I have table text and 3 table fields:
ID
intro_text (ntext)
main_text (ntext)

I'd like to merge intro_text into main_text and merge all data that in this field (2000 records)

If the data in intro_text is: "Any questions and discussions related specifically to SQL Server tools." and in main_text is: "For discussions on features exposed through tools, please post to the directly-related forum" I'd like to have only one field main_text with data: "Any questions and discussions related specifically to SQL Server tools. For discussions on features exposed through tools, please post to the directly-related forum". In intro_text is only text, there is not images or any another files

Is there possibility to make this merging without making new database because I have 2000 records in text data table

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-02 : 08:47:11
UPDATE [text]
SET intro_text=intro_text+main_text
Go to Top of Page

Dejan
Starting Member

14 Posts

Posted - 2009-01-02 : 08:52:29
Hi visakh16

I receive error:

Error -2147217900


Operand data type ntext is invalid for add operator.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-02 : 09:02:14
quote:
Originally posted by Dejan

Hi visakh16

I receive error:

Error -2147217900


Operand data type ntext is invalid for add operator.


then use UPDATETEXT given in link

http://www.sqlservercentral.com/articles/Miscellaneous/handlingthetextdatatype/985/
Go to Top of Page
   

- Advertisement -