Using Output in a Stored Procedure

Results 1 to 2 of 2

Thread: Using Output in a Stored Procedure

  1. #1
    Join Date
    Dec 1969

    Default Using Output in a Stored Procedure

    Im trying to create a SP that will do two things. <BR><BR>One create an output varaible based on a passed ID from ASP<BR>Two perform a Delete based on a passed ID from ASP<BR><BR>Here is what I have both in asp and SQL<BR><BR>ASP<BR>Set conn = Server.CreateObject("ADODB.Connection") <BR>Set rs = Server.CreateObject("ADODB.Recordset") <BR>conn.Open MM_MPI_STRING<BR><BR>rs.Open "Exec dbo.usp_Delete_MedNetMember " & MembID , conn, 3, 3 <BR><BR>Response.Write rs("MemberName")<BR><BR><BR>SQL<BR>CREATE PROCEDURE [dbo].[usp_Delete_MedNetMember] <BR>(<BR> @MemID int,<BR> @MemberName varchar(100) OUTPUT<BR>)<BR><BR>AS<BR><BR><BR>SET @MemberName = <BR> (SELECT AllMembs.Lname + &#039; &#039; + AllMembs.Fname AS &#039;MemberName&#039;<BR> FROM AllMembs <BR> WHERE MembID = @MemID)<BR><BR>DELETE AllMembs WHERE MembID = @MemID<BR><BR><BR>SELECT @MemberName<BR><BR>The error that is coming back is:<BR>Error Type:<BR>Microsoft OLE DB Provider for SQL Server (0x80040E21)<BR>Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.<BR>/GRIPANET/Administrators/IT/MedNet_DeleteMemb_delete.asp, line 27<BR><BR><BR>Line 27 is the EXEC line in the asp script<BR><BR>

  2. #2
    Join Date
    Dec 1969
    Indianapolis, IN

    Default Read this article...

    It should help you do to do what you&#039;re wanting:<BR> (this is page 2 of the article)

Posting Permissions

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