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)
 How to convert many varchar(255) into one ntext?

Author  Topic 

Martinator
Starting Member

4 Posts

Posted - 2008-11-20 : 20:18:04
Hello everyone, I'm looking for guidance on how to stitch together many text pieces from a table with sequenced varchar(255) text lines into a single piece of text for a new table with an ntext text column. The total text size of the largest entries can be up to 25 to 30K.

I tried updating the ntext column by converting it to varchar(8000) and concatenating the next text piece but that won’t handle the largest entries.

I’m hoping there is a transact-sql solution.

Any ideas or sample code will be great appreciated

Cheers and TIA

Martin Kultermann
eStar Communications
Office: +1 (312) 275-0291
Email: Martinator@eStarMail.com

nr
SQLTeam MVY

12543 Posts

Posted - 2008-11-20 : 20:40:43
Are you using v2005?
In which case use varchar(max).
If not then post in the right forum and see
http://www.nigelrivett.net/SQLTsql/InsertTextData.html
http://www.nigelrivett.net/SQLTsql/ReplaceText.html

A combination of those should do it.
Are you sure you can do whatever you need to with a text datatype?


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

Martinator
Starting Member

4 Posts

Posted - 2008-11-21 : 10:39:26
Thank you nr, that looks perfect. It is 2000

Sorry, I started in the 2000 forum and somehow ended up here after the registration.

Thanks again

Martin Kultermann
eStar Communications
Office: +1 (312) 275-0291
Email: Martinator@eStarMail.com
Go to Top of Page
   

- Advertisement -