create table tb(s varchar(50))
insert into tb select '<img src="xxxxx" />'select * from tb where s like '%m%'--能查到的
<img src="xxxxx" />

解决方案 »

  1.   

    declare @t table(col varchar(100))
    insert @t select 'mmm'
    insert @t select '<img src="xxxxx" />'
    select * from @t where col like '%m%'  
     /*
    col                                                                                                  
    ---------------------------------------------------------------------------------------------------- 
    mmm
    <img src="xxxxx" />(所影响的行数为 2 行)*/
      

  2.   

    貌似你们理解错了
    比如:我要查询文章内容里包含M的所有文章  select * from XXX where XXX like '%M%' 
         结果有好多文章里面没有M居然也被查出来了,我发现原来是因为文章内容里包含了<IMG>标签
          所以我要的是查询文章内容里包含M的所有文章,且M并不是在HTML标签里的
          
          由于要符合公司框架,不能假借第3张表或视图,也太不适合在C#代码里判断