Sql传参含有单引号

程序
    exec  heduling_date_select 
    '   Name like @%a%@ or phone like @%a%@ or Cus_code like @%a%@ 
or objjc like @%a%@ or Doctor like @%a%@'

存储过程
set @where = replace(@where,'@',char(39))

或者 用两个单引号代替一个
exec heduling_date_select ' Name like ''%a%'' or phone like ''%a%'' or Cus_code like ''%a%'' or objjc like ''%a%'' or Doctor like ''%a%'''

 

posted @ 2016-08-29 09:21  萧紫紫  阅读(684)  评论(0)    收藏  举报