create PROCEDURE [dbo].[sp_get]
(
@Condition char(500)
)
as
select *
from S
where @Condition --***
GO
...全文
944打赏收藏
我把“where”当参数传进去,这个存储过程该怎么写?
程序中用户可以任意选择查寻条件。我把这些条件做成一个字符串,当参数传到存储过程里。但SQL语句该怎么写啊?? @Condition就是传进去的条件。 create PROCEDURE [dbo].[sp_get] ( @Condition char(500) ) as select * from S where @Condition --*** GO