[o-ö] x -> [x-ks]" />
开发者

T-SQL Operators LIKE need help

开发者 https://www.devze.com 2023-01-19 04:40 出处:网络
i would like to search in DB 开发者_运维百科 input string is \"oxoşil\" o -> [o-ö] x -> [x-ks]

i would like to search in DB

开发者_运维百科

input string is "oxoşil"

  1. o -> [o-ö]
  2. x -> [x-ks]
  3. ş -> [s-ş]
  4. ş -> [ş-sh]

i need to search all of these cominations. Needed finally search criteria is [o-ö][x-ks][o-ö][ş-s-sh][i-ı]l

is there any way to to this with t-sql like operator? or in linq?


I would try coercing the collation to accent-insensitive.Of course, choose an appropriate one for you rather than latin/general

WHERE
    myCol COLLATE LATIN1_GENERAL_CI_AI LIKE '%oxoşil%' COLLATE LATIN1_GENERAL_CI_AI


One efficient way to do this is use a CLR Stored Procedure:

Regular Expressions Make Pattern Matching And Data Extraction Easier

See also: TSQL Regular Expression Workbench

0

精彩评论

暂无评论...
验证码 换一张
取 消