Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find value in SQl string

Status
Not open for further replies.

retygh45

IS-IT--Management
May 23, 2006
166
US
I'm using SQL server 2000, and just not sure how to parse out the information I want from a varchar string. The sting looks something like this:

D:\MailRoomImporter\incoming_documents\releases\OC\11024714.tif


and I'm trying to parse out just the word "releases". So, I'm trying to get everything to the right of "incoming_documents\" and everything to the left of the next "\"

These are log files of where images are stored, and I'm trying to parse out the directory name, in this case in the "releases" folder.

Any help is greatly app0reciated, thanks!
 
Have a look at the CHARINDEX and SUBSTRING function in books on line, and post back if you have any problems.

[small]----signature below----[/small]
I'm pushing an elephant up the stairs

My Crummy Web Page
 
Code:
Declare @ColumnName varchar(60) 
set @ColumnName = 'D:\MailRoomImporter\incoming_documents\releases\OC\11024714.tif'
select replace(@ColumnName,'\releases\','\')
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top