VARCHAR(MAX)のテキストブロブを検索する簡単な検索ツールを実行するためのレポートを作成しています。私はユーザーが2つの異なる検索タイプを選択できるようにしようとしています:すべての検索用語を含み、任意のものを含みます。私は、Contains allとContains anyの間で変更するための構文を見つけるのが難しいです。以下は私がそれが働く方法の要点です。助けてくれてありがとう!Transact-SQLでは、Contains allとContainsの間でどのようにパラメータを使用するかを変更しますか
Where Reprt.DateStamp >= @StartDate and Reprt.DateStamp <= @EndDate and
IF @SearchType = 'And'
Reprt.ContentText like '%'[email protected]+'%' and
Reprt.ContentText like '%'[email protected]+'%' and
Reprt.ContentText like '%'[email protected]+'%' and
Reprt.ContentText like '%'[email protected]+'%'
Else
Reprt.ContentText like '%'[email protected]+'%' or
Reprt.ContentText like '%'[email protected]+'%' or
Reprt.ContentText like '%'[email protected]+'%' or
Reprt.ContentText like '%'[email protected]+'%'
タイプミス申し訳ありません意味さトランスまたはTransact-SQL –