Returning a Decimal Value in a stored procedure

Viewed 37

I am trying to return a value that is a sum of decimal value in SQL Server 2008. I've tried using convert but it doesn't help. Here is the relevant code snips:

    @ActivitySum dec (18,2) OUTPUT)
AS
    SELECT       
        @DistinctActivities = COUNT(DISTINCT [Activities].[Activity ID]), 
        @Activities = COUNT([Activities].[Performer Activity ID]), 
        @ActivitySum = SUM(Activities.[Score])
    FROM            
        Scenes 
    INNER JOIN

Every time I execute, if the sum of score has value after the decimal point, the value gets rounded to a whole number.

Any thoughts or solutions?

0 Answers
Related