Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Advanaced Substrings with TEXT
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Yak Posting Veteran

93 Posts

Posted - 08/01/2007 :  14:43:14  Show Profile  Visit shawnmolloy's Homepage  Reply with Quote

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??

Patron Saint of Lost Yaks

30421 Posts

Posted - 08/01/2007 :  17:47:19  Show Profile  Visit SwePeso's Homepage  Reply with Quote
SUBSTRING and CHARINDEX do work on TEXT data type.

E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000