sql server 中使用 LIKE 语句 SqlParameter 使用

原本写的 select * from table where name like  '%@searchStr%'

怎么执行都不对,想想 参数是不能加 引号的

于是改为select * from table where name like   '%'+@searchStr+'%' 则正确执行

posted @ 2013-07-07 15:07  文刀君  阅读(1077)  评论(0编辑  收藏  举报