SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Advanaced Substrings with TEXT
 New Topic  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

30407 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  
 New 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.06 seconds. Powered By: Snitz Forums 2000