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)
 Advanaced Substrings with TEXT

Author  Topic 

shawnmolloy
Yak Posting Veteran

93 Posts

Posted - 2007-08-01 : 14:43:14
Hi,

I have a "TEXT" column called NewsItem that contains an XML snippet that looks like this:

Column Result Data:

<summary-body><headline><main-hed>How Can I Get New Gadgets for Vista Sidebar?</main-hed></headline><p><highlight type="BOLD">Walt Mossberg answers</highlight> questions about getting new Gadgets for Vista Sidebar, the type of keyboard on the BlackBerry Curve, and whether the iPhone will allow third-party programs to be installed.</p></summary-body>


I want to LIMIT the INNER CONTENT of this data to 50 characters, meaning everything inside <main-hed> should amount to 50 characters max.

What is a good way to accomplish such advanced string manipulation with sql??

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-08-01 : 17:47:19
SUBSTRING and CHARINDEX do work on TEXT data type.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page
   

- Advertisement -