views:

86

answers:

1

I got a distance field in my database that stores the distance traveled on a specific route.

I need to select all the distance fields and plus them together, then returning the result from my stored procedure.

How can this be done?

+2  A: 

Something like this:

CREATE PROCEDURE SumDistances
AS
BEGIN
    SELECT SUM(Distance)
    FROM MyTable
END
Ronald Wildenberg
Exactly. Never thought it would be that easy. Thank you! :-)
meep