calling store procedure

Results 1 to 2 of 2

Thread: calling store procedure

  1. #1
    Join Date
    Dec 1969

    Default calling store procedure

    How to call a stored procedure which returns a value after passing few parameters from ASP

  2. #2
    Join Date
    Dec 1969

    Default RE: calling store procedure

    Here is one...<BR><BR>Code in the ASP page:<BR>***************************************** **********************<BR><BR>Set cmdAddLogin = Server.CreateObject("ADODB.Command")<BR> <BR>cmdAddLogin.ActiveConnection = Conn<BR>cmdAddLogin.CommandText = "sp_Users" <BR>cmdAddLogin.CommandType = adCmdStoredProc <BR> <BR>cmdAddLogin.Parameters.Append cmdAddLogin.CreateParameter("paramemail", adVarChar, adParamInput, 50, Request.Form("EMAIL"))<BR>cmdAddLogin.Parameters.A ppend cmdAddLogin.CreateParameter("paramcid", advarchar, adParamOutput, 9) <BR> <BR>cmdAddLogin.Execute <BR>********************************************** ***************<BR><BR>Here is the code in my stored procedure:<BR><BR>Plese note that the parameter paramcid is an identity column in the database. And I am returning it back to the ASP page.<BR>***************************************** *********************<BR>CREATE PROCEDURE dbo.sp_Users<BR><BR>@paramemail varchar(50),<BR>@paramcid int OUT<BR><BR>AS<BR>set nocount on<BR>insert into dbo.login (EMAIL) <BR> <BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts