试试
UNION 改成:
UNION ALL

解决方案 »

  1.   

    LIKE左侧必须字符串数据类型的有效 SQL Server 表达式,不能是text、ntext 或 image 数据类型。
      

  2.   

    union 相当于两个结果集合并后DISTINCT,而对text、ntext 或 image 数据类型不可以这样的,改成一个select 就行了:
    select * from Book where
    (homepage like '%'+'atest'+'%' or content like '%'+'atest'+'%' or reply like '%'+'atest'+'%')
    or
    (homepage like '%'+'a'+'%' or content like '%'+'a'+'%' or reply like '%'+'a'+'%' or homepage like '%'+ 'test'+'%' or content like '%'+'test'+'%' or reply like '%'+'test'+'%')