关于存储过程中参数调用的问题!!!
来源:百度知道 编辑:UC知道 时间:2024/05/01 07:08:03
在一个存储过程调用另一个存储过程中,怎么将被调用的存储过程中的输出参数传出来?可否用一个具体一点的例子指点下小弟。谢谢
该存储过程是分页用的,所以必须固定查询参数
------------其VB.NET参数语句如下
cmd2.Parameters.Add(New System.Data.SqlClient.SqlParameter("@tel", SqlDbType.VarChar)).Value = cs_tel
其中@tel在为存储过程输入参数,其定义是@tel VarChar(20)
cs_tel的来源代码是:
If Request.Form("tel") <> "" Then
cs_tel = Request.Form("tel")
Else
cs_tel = "1"
End If
------------存储过程中的查询语句是
select id from kl10000 where tel like @tel+'%' order by tel desc
--------------------------------------------------------------------
可是现在我在表单无论输入什么数字,得到的都只是包含第一个数字的结果,
比如,我输入2568,查询,得到的却是开头包含"2"的所有结果,而非开头包含"2568"的所有结果..
咋回事呢?
回复人:singlepine(小山) 2005-05-08 18:45:00 得分:0
? 改为select id from kl10000 where tel like '%'+@tel+'%' order by tel desc
Top
回复人:mg42(曼斯坦因) 2005-05-08 20