LIKE not working in TSQL

眉间皱痕 提交于 2019-12-01 11:09:30

In TSQL the underscore is a wildcard representing a single char.

In order to escape in you need to wrap it with square brackets, like this:

'BANK[_]%'

See this page: http://www.dirigodev.com/blog/web-development-execution/escaping-percent-and-underscore-characters-in-t-sql-like-clause/

An underscore in SQL Server is reserved for a wild card character, I think. You need to escape it.I think you can put it in brackets:

%[_]%
Gratzy

You need to escape the "_". It is a special character for the Like statement. You can enclose it in [].

See LIKE (Transact-SQL).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!