WHERE clause on SQL Server “Text” data type

前端 未结 7 2487
不思量自难忘°
不思量自难忘° 2020-11-28 09:52

Where [CastleType] is set as data type \"text\" in SQL Server and the query is:

SELECT *
FROM   [Village]
WHERE  [CastleType] = \'foo\' 

I

7条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-28 10:24

    You can't compare against text with the = operator, but instead must used one of the comparison functions listed here. Also note the large warning box at the top of the page, it's important.

提交回复
热议问题