SQL Server sucks at regexps, you have some rudimentary tools at your disposal with the LIKE statement, but none that I could get to work, I have in the past found a regexp stored procedure but that's just dog slow...
This is the like statement I tried: SELECT * FROM listing WHERE dir LIKE <cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="warranty\%[^\]"> It doesn't work because the % sign already matches to the end of the string... so sorry :( Mingo. Brian Dumbledore wrote: > I am using MS-SQL, I couldn't get this to work.. > > I tried, patindex,charindex, like combinations, none worked. > > I have directory paths in a table, given a starting path of a directory, I > want to get its first level elements. > > eg: > > table has > warranty\a\1.jpg > warranty\a > warranty\a\2.jpg > warranty\a22 > warranty\a-23 > > I want to get warranty\a,warranty\a22,warranty\a-23 > > I tried all combinations, it doesn't work (correctly). I actually get only > warranty\a, but don't get the other two (which makes me thing it is because > of the numbers in the string.. but doesn't make any sense). Please help > > Thanks for your time. > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:248683 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

