Escape Character in SQL Server

前端 未结 9 1411
时光取名叫无心
时光取名叫无心 2020-11-29 03:22

I want to use quotation with escape character. How can I do?

I have received error in SQL Server

Unclosed quotation mark after the character strin

9条回答
  •  -上瘾入骨i
    2020-11-29 03:38

    You can define your escape character, but you can only use it with a LIKE clause.

    Example:

    SELECT columns FROM table
    WHERE column LIKE '%\%%' ESCAPE '\'
    

    Here it will search for % in whole string and this is how one can use ESCAPE identifier in SQL Server.

提交回复
热议问题