我在执行如下SQL查询语句时,系统报The data types text and varchar are incompatible in the equal to operator错误提示,哪位大侠帮忙看一下问题出在哪里?数据库中receivedPersons字段类型是text类型。
select top 100 * from workflow_requestlog where receivedPersons='李冰'
SQLServer中的text类型是不能直接按字符串的格式查询的,你可以先进行转换一下,类似如下:
select top 100 * from workflow_requestlog where CAST([receivedPersons] AS [nvarchar](200)) ='李冰'
SQLServer中的text类型是不能直接按字符串的格式查询的,你可以先进行转换一下,类似如下: