Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stored Procedures for sum

Status
Not open for further replies.

prprogrammer

Programmer
Jun 25, 2004
49
PR
I need a sp to sum one column and return the sum value but if the sum is nothing i need to return 0 right the sp return null values right now.

my sp

create procedure dbo.name
@var1 int output
as
select @var1 = sum(field) as total......



 
create procedure dbo.name
@var1 int output
as
select @var1 = isnull(sum(field),0) as total

Tim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top