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)
 Splitting a text field into varchar(8000) fields

Author  Topic 

danielhai
Yak Posting Veteran

50 Posts

Posted - 2002-12-04 : 15:24:24
is there a function that will split a text field into varchar(8000) fields? I know a lot of functions won't let me do that ... anyone dealt with this problem before?

ValterBorges
Master Smack Fu Yak Hacker

1429 Posts

Posted - 2002-12-04 : 15:50:47
You can create a temp table with the following columns:

id identity, varchar(8000)

Take a look at bol under
Retrieving ntext, text, or image Values
for creating a pointer to a text field. Next use a while loop to retrieve chunks of 8000 bytes and insert them into the temp table. You can then take the rows from the temptable and do whatever you need.

Go to Top of Page
   

- Advertisement -