I would like to build one sql query in that one of my filed of form should not contain common names (maintained list of words in separate table) and i am passing value of that filed as parameter and want to check that it shouldn’t contain any common name from that table.
How can i achieve that using sql query?
Note : if common name is ‘abc’ and i am passing parameter as ‘!abc123’ since it contains that word query should return false.
Thanks in advance.
Try this:
This works if the
@yourParamis contained in any word or name, what you do not want to use. It only returns 1 if it is not contained by any row in the table.I worte this sentence only on this way (you can use a simple Exists instead of NOT Exists), because may you want to extend the functionality in the true part.