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

Return rows where string matches

Status
Not open for further replies.

TRACEYMARYLAND

Programmer
May 21, 2004
370
US
I have a description field that consists of
(1)SD3-UZA08-GZ(2)LF-40-1(8)FR-24-48(4)HS-X-P(1)WP-18-S(2)
(1)SFR-UZA08-ZK
(1)SCM-WaA09-ZG(2)DG-5.5(4)LF-40-1(1)AH-125-15(1)WP-18-S(1)WH-340-1-1
(2)SD1-TTB02-GZ
(1)SD3-UZA08-GZ(2)LC-1810-X(1)LCA-B(4)HS-X-P(8)FR-24-48
(1)SCM-WaA10-ZG
(1)HW-D20C-.50-CFCF(1)HW-D20B-.50-CFCF
(1)HW-D20C-.50-CFCF(1)HW-D20B-.50-CFCF(2)LF-40-1
Now i like to just return rows where part of the value equals an input variable

I.e equal SD3 or equals SCM-Wa

Where do i start researching this
 
You start with string functions in BOL. Charindex and Patindex might be helpful. Then lookup the Like predicate in Where clause.
-Karl

[red] Cursors, triggers, user-defined functions and dynamic SQL are an axis of evil![/red]
[green]Life's uncertain...eat dessert first...www.deerfieldbakery.com[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top