存储过程方面的问题,请各位帮忙给看看,急用,谢了!分不够来这领,谢了!
想实现下面这段代码的功能,用存储过程实现,老是写不对,请各位指点!
if(dep<>"无") then
set RS=conn.execute("select * from doctorinfo where " _
& "name like '%" & request.form("doctorkey") & "%' and " _
& "department ='" & request.form("department") & "'")
else
set rs=conn.execute("select * from doctorinfo where " _
& "name like '%" & request.form("doctorkey") & "%'")
end if
我写的是这样
create proc searchdoctor @dep char(30),@name char(20)
as
if dep<>'无'
select * from doctorinfo where name like '%+@doctor+%' and department ='+@dep
else
select * from doctorinfo where name like '%+@doctor+%'
go
不会写带参数的,还有就是 like '%fff%' 这种类型带参数的怎么写呀?