How to execute function in SQL Server [closed]
I built a function and I am trying to execute it… but some errors are occurring
CREATE FUNCTION dbo.Afisho_rankimin
(
@emri_rest int
)
RETURNS int
AS
BEGIN
Declare @rankimi int
Select @rankimi = dbo.RESTORANTET.Rankimi
From RESTORANTET
Where dbo.RESTORANTET.ID_Rest = @emri_rest
RETURN @rankimi
END
GO
SELECT dbo.Afisho_rankimin(5) AS Rankimi
GO