写一个带参数的存储过程??

SuperBJack SuperBJack 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
只有一个存储过程"pd_myselect"
有两个参数:参数1(颜色),参数2(码数)
如果选择"(颜色)"就把参数1传回"pd_myselect"的查询语句中,
如果选择"(码数)"就把参数2传回"pd_myselect"的查询语句中,
如果选择"(颜色)"和"(码数)"就把参数1,参数2传回"pd_myselect"的查询语句中

这个存储过程在SQL中怎么写?请教各位朋友.

---------- 代替下面的-(ASP)----
wstr="where"
if styles<>empty and styles<>"All" then wstr=wstr&" Styles ='"& styles &"' and"
if material<>empty and material<>"All" then wstr=wstr&" Material ='"& material &"' and"
if right(wstr,3)="and" then wstr=left(wstr,len(wstr)-3)
if len(wstr)=5 then wstr=""
strSQL = "SELECT * FROM products "&wstr

_____________________--
...全文

相关推荐

评论 6
收藏 已收藏
分享
返回顶部
SuperBJack
ASP 28,401 成员 356,940 内容