I have a stored procedure and if the value from the SQL statement is null I want to to be zero. However, if the value is null it is passed back my my ASP page as null and not as 0. My code is below, I was wondering if you guys could take a look at it and tell me if I did something wrong. Thanks!
CREATE PROCEDURE sp_Inventory_Valuation
@reportID smallint,
@storenum tinyint,
@InvValue int OUTPUT,
@Sku int OUTPUT
AS
SELECT @InvValue=isNull(Merch,0), @Sku=isNull(SkuCount,0) from SalesAnalysis where reportID_MO = @reportID and PCnum = @storenum
CREATE PROCEDURE sp_Inventory_Valuation
@reportID smallint,
@storenum tinyint,
@InvValue int OUTPUT,
@Sku int OUTPUT
AS
SELECT @InvValue=isNull(Merch,0), @Sku=isNull(SkuCount,0) from SalesAnalysis where reportID_MO = @reportID and PCnum = @storenum