Return values of stored procedures from SQL Server

Results 1 to 2 of 2

Thread: Return values of stored procedures from SQL Server

  1. #1
    J Guest

    Default Return values of stored procedures from SQL Server

    Hi all,<BR><BR>I was wondering how to get the return value of a stored procedure from SQL Server after executing the sp via the command object. For example sp_password changes the login password and returns either a 1 or 0 depending on success or failure. How would I find this value out. Below is my code to execute the procedure.<BR><BR>set objCmnd.ActiveConnection = objConn<BR><BR> set parOldPAss = objCmnd.CreateParameter<BR> parOldPass.Name = "@old"<BR> parOldPass.Type = adVarchar<BR> parOldPass.Direction = adParamInput<BR> parOldPass.Size = 30<BR> parOldPass.Value = request.form("OldPassword")<BR> objCmnd.Parameters.Append parOldPass<BR> set parNewPass = objCmnd.CreateParameter<BR> parNewPass.Name = "@new"<BR> parNewPass.Type = adVarchar<BR> parNewPass.Direction = adParamInput<BR> parNewPass.Size = 30<BR> parNewPass.Value = request.form("NewPassword1")<BR> objCmnd.Parameters.Append parNewPass<BR> <BR> objCmnd.CommandText = "sp_password"<BR> objCmnd.CommandType = adCmdStoredProc<BR> objCmnd.Execute()<BR><BR><BR>Thanks,<BR>J

  2. #2
    Join Date
    Dec 1969

    Default RE: Return values of stored procedures from SQL Se

    you have to set a recorset to the stored procedure even though you are only getting one sure give the field a name in the SP

Posting Permissions

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