存储过程的问题
<%
wp=request("wpmc")
xh=request("ggxh")
sql="select * from wpjbxx"
if wp<>"" then
sq1= sql & " and wp='"&wp&"'"
end if
if xh<>"" then
sq1= sql &" and xh='"&xh&"'"
end if
rs.open sql,conn,1,1
%>
把上面的用存储过程写出来
CREATE PROCEDURE wp_deatil1
( @mc varchar(50),
@xh varchar(50)
)
AS
Declare @sql varchar(6000)
set @sql = 'select * from wpjbxx where 1=1'
if @mc<>'' begin
set @sql = @sql + 'and wpmc='+ @mc
end
if @xh<>'' begin
set @sql = @sql + 'and ggxh='+ @xh
end
exec(@Sql)
GO
然后在程序中调用这个存储过程,可怎么弄都不行。
在程序中怎么调用存储过程啊,麻烦够手给写个调用上面的存储过程的代码吧。