Unix Technical Forum

tsql Substring question

This is a discussion on tsql Substring question within the SQL Server forums, part of the Microsoft SQL Server category; --> I am trying to find a way to dynamically retrieve the substring starting point of an nText field. My ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-29-2008, 05:33 AM
sysindex@gmail.com
 
Posts: n/a
Default tsql Substring question

I am trying to find a way to dynamically retrieve the substring
starting point of an nText field.
My query looks something like,

SELECT ID,Substring(DOCTEXT,0,200) from mytable where DOCTEXT like
'claim%'"

This query has the substring starting point set to 0. Is there a way to
determine the starting point based on the first occurrence of the
search term? If first occurrence of 'claim' is at 25th character then
the query should start substring process at 25th and end at 225th
character. I am trying to avoid usage of UDF. Is there a to handle this
through plain SQL statements? Any help would be appreciated. TIA.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:51 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com