The function is as follows
CREATE FUNCTION StockBalance_AmountIn (@SortID int) RETURNS numeric (18,4) AS BEGIN Declare @dblReturn numeric (18,4) Select @dblReturn = SUM (AmountCurrentMonthIn) From AT_Materiel_StockBalance Where SortID = @SortID Return (@dblReturn) END
Call method Select dbo.stockbalance_amountin (2523)
Here you need to add DBO