Using variable in SQL LIKE statement

前端 未结 9 1361
夕颜
夕颜 2020-12-05 08:52

I\'ve got a sproc (MSSQL 2k5) that will take a variable for a LIKE claus like so:

DECLARE @SearchLetter2 char(1)
SET @SearchLetter = \'t\'
SET @SearchLetter2         


        
9条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-05 09:35

    It may be as simple as LIKE '%%[%3]%%' being [%3] the input variable.

    This works for me with SAP B1 9.1

提交回复
热议问题