sql server - How to match patterns stored in SQL table -


i'm trying setup system can store phrases containing data placeholders in table can matched user's input string. example, today [date] stored in column , potentially positively matched phrase today tuesday. solution need fast. backend mssql , .net. ideas?

your matching options in sql like:

where columnname = 'today tuesday' 

or

where columnname 'today %' 

or

where columnname in ('today monday', 'today tuesday', 'today wednesday') 

any of fast. use .net code build in list of potential placeholder replacements.

just beware of query like:

where columnname '% today' 

this slower because leading wildcard makes impossible sql server use columnname index (if 1 exists), , instead perform table scan.


Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -