开发者

SQL LIKE convert to SQL CONTAINS

开发者 https://www.devze.com 2023-03-20 02:13 出处:网络
What is the right syntax for converting a SQL Like to Contains in the following fragment statement: WHERE ReferenceNo LIKE \'%\' + @SearchString+ \'%\'

What is the right syntax for converting a SQL Like to Contains in the following fragment statement:

WHERE ReferenceNo LIKE '%' + @SearchString+ '%'

I have converted it to:

WHERE ReferenceNo CONTAINS(VendorName, @SearchString)

VendorName is in the SELECT statement.

Thanks in advan开发者_运维技巧ce. :)


If you were just converting the WHERE statement you showed, it would be

WHERE CONTAINS(ReferenceNo, @SearchString)
0

精彩评论

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