阅读背景:

在sql server 2005中的单引号包含单引号的写法

来源:互联网 
create proc Proc_GetOrderInfo_ByStatus( @Flag int)asdeclare @Msql varchar(1024)set @Msql = 'select * from vw_aspnet_OrderInfo where 1=1 'if(@Flag=1) set @Msql = @Msql + 'and IsConfirm = ''false'''else if(@Flag=2) set @Msql = @Msql + 'and IsConfirm = ''true'''else if(@Flag=3) set @Msql = @Msql + 'and IsConsignment = ''false'''else if(@Flag=4) set @Msql = @Msql + 'and IsConsignment = ''true'''else if(@Flag=5) set @Msql = @Msql + 'and IsPayment = ''false'''else if(@Flag=6) set @Msql = @Msql + 'and IsPayment = ''true'''else if(@Flag=7) set @Msql = @Msql + 'and IsPigeonhole = ''false'''else if(@Flag=8) set @Msql = @Msql + 'and IsPigeonhole = ''true'''exec(@Msql) create proc Proc_GetOrderInfo_ByStatus( @Flag i



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: