あなたはいくつかのものが欲しいです。まず、SQL Serverの関数の構文を調べて、次のように記述します。
-- Warning! Code written off the top of my head,
-- don't expect this to work w/copy-n-paste
create function removeStrings(@input nvarchar(4000))
as begin
-- We're being kind of simple-minded and using strings
-- instead of regular expressions, so we are assuming a
-- a space before and after each word. This makes this work better:
@input = ' ' + @input
-- Big list of replaces
@input = replace(' in ','',@input)
@input = replace(' out ','',@input)
--- more replaces...
end
次に、テーブル内の一致のリストが必要です。これを「matchString」列で「事前定義」と呼びます。
次に、次のコマンドで一致する行を取得できます。
select p.matchString
from items i
join predefined p
on removeStrings(i.title) = p.matchString
それらの個々の部分が機能するようになったら、それらを使用してどのような特定のプロセスを実行しているのかについて、新しい質問を提案します。
警告:行数やこれを実行する頻度(ユーザーが何かを保存するたびに?1日1回?)がわからない場合、私が何を意味するかを知っていれば、これは正確には問題になりません。したがって、これらのビルディングブロックを手に入れたら、それをいつどのように行うかについてのフォローアップの質問もあるかもしれません。