联机从书,现成的:CREATE PROCEDURE get_sales_for_title
@title varchar(80) = NULL,  -- NULL default value
@ytd_sales int OUTPUT
AS  -- Validate the @title parameter.
IF @title IS NULL
BEGIN
   PRINT 'ERROR: You must specify a title value.'
   RETURN
END-- Get the sales for the specified title and 
-- assign it to the output parameter.
SELECT @ytd_sales = ytd_sales
FROM titles
WHERE title = @titleRETURN
GO

解决方案 »

  1.   

    不是这个,是要,asp中输入参数的时候写的.
    需要设置输入参数的数据类型
      

  2.   

    示例如下:
    dim sSQL
    dim cmd
    dim parm0
    dim parm1
    ...
    sSQL = 'create proc CountStoreQty " _
     & "(@stor_id CHAR(4),@qty INT OUTPUT" as  _
     & "select @qty = sum(qty) from sales where stor_id = @stor_id"cn.Exectute sSQL'Create a connection object
    set cmd = Server.CreateObject("ADODB.Command")
    set parm0 = Server.CreateObject("ADODB.Parameter")
    set parm1 = Server.CreateObject("ADODB.Parameter")'User a seeion level connection object - cn
    cmd.CommandType = adCmdStoredProc
    cmd.CommandText = "CountStoreQty"parm0.Directioin = adParamInput
    parm0.Type = adChar
    parm0.Size = 4
    cmd.Parameters.Append parm0parm1.adParamOutput
    parm1.Type = adInteger
    parm1.Size =4
    cmd.Parameters.Append parm1
    set Session("SP1") = cmd
    ....
      

  3.   

    不是要这个,我是要varchar 的对应数值...int的对应数值,如果是INT型需要写什么传入参数