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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems searching through a string for links

Status
Not open for further replies.

Hdiva

Programmer
Feb 8, 2005
3
US
I am working with an HTML Editor used to create and edit manuals on the web. When a document is deleted, I have to search the table field that holds the html code for the document. I know I have to find the position of the characters I am looking for but they don't necessarily the same. I need to loop through the string and write out the source document and linked documents. Here is a sample string.

<!DOCTYPE HTML PUBLIC '-//IETF//DTD HTML//EN'><HTML><HEAD><TITLE>Page-1</TITLE><META NAME='GENERATOR' CONTENT='Visio 5.0'></HEAD><BODY BGCOLOR='#ffffff'><CENTER><IMG alt=Page-1 border =0 src='file://O:/Wrkgrp/Halco21/PRef/Manage Product Definition Data.gif' useMap=#visImageMap > </CENTER><P><HR><CENTER></CENTER><BR><CENTER>Page 1 of 1<BR></CENTER><MAP NAME='visImageMap'> <AREA SHAPE='POLY' ALT ='' HREF='Matrix Population of SAP.htm' COORDS='171,543,267,543,267,471,171,471' > <AREA SHAPE='POLY' ALT ='' HREF='Perform Production Release.htm' COORDS='315,435,411,435,411,363,315,363' > <AREA SHAPE='POLY' ALT ='' HREF='Perform Manufacturing Design Review.htm' COORDS='315,291,411,291,411,219,315,219' ></MAP></BODY></HTML>


 
You'll want to use CHARINDEX, PATINDEX, and Substring to do what you are looking for. You'll find more info on them in BOL.

Denny
MCSA (2003) / MCDBA (SQL 2000)

--Anything is possible. All it takes is a little research. (Me)

[noevil]
(Not quite so old any more.)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top