给参数赋值(高手进)
create proc P_GetOperator
(@Condition varchar(1000),@PageSize int
)
as
exec('select '+@PageSize+' * from tbl_Operator '+@Condition+'')
go
我在asp.net为上述存储过程传查询条件参数
"where OperatorNO like '"+this.textbox1.Text+"%'"
为什么查询不出结果?
结果发现在SQL语句执行存储过程时,要这样才可以exec p_GetOperator 5,'where OperatorNo like ''张%'''
为什么要二个单引号?