Re: stored proc RETURN_VALUE.... there it is, I want to use it !!!



Hi Betsy,

I have just looked at your latest SQL code, and I think you need:

CREATE PROCEDURE dbo.getPayments
@meetingCode char(6),
@guestid char(10),
@total int OUTPUT
AS
SELECT @total = SUM(amount)
FROM dbo.payments
WHERE meetingCode = @meetingCode and guestid = @guestID
GO

Then you can read the value of @total after closing the query.

HTH

Ron.

"Betsy" <betsy.a.tainer@xxxxxxxxxxxxx> wrote in message
news:426fdc0b$1@xxxxxxxxxxxxxxxxxxxxxxxxx
> forgot my stuff:
>
> here's the stored proc as it exists at this moment:
> CREATE PROCEDURE dbo.getPayments @meetingCode char(6), @guestid char(10)
AS
> select sum(a.amount) as total from dbo.payments a
> where (A.meetingCode= @meetingCode) and (a.guestid = @guestid)
> GO
>
<snip>


.



Relevant Pages

  • Re: Remove "Allow Null" property from column
    ... Can you also tell me the sql code, or any other way of checking if a ... column has "allow null" property set? ... Alex ... Prev by Date: ...
    (microsoft.public.sqlserver.ce)
  • Re: Checking to see if a database exists...
    ... > I'm creating databases programatically in .Net and I want to verify that ... i found the SQL code: ... come to the conclusion that this new system SUCKS." ... Prev by Date: ...
    (microsoft.public.dotnet.languages.vb)
  • Always Pick Last Months $
    ... How do I change the snipped of SQL code below to force it to always choose ... This is from a quarterly query that sums some fields, ... it picks what it interprets to be the last entry in the result set. ... Prev by Date: ...
    (microsoft.public.access.queries)
  • Re: Show all records in query if conditions is false
    ... John Spencer (MVP) wrote: ... > Field: ProjectCreator ... Alternatively (in SQL code): ... Prev by Date: ...
    (microsoft.public.access.queries)