In TSQL I just created a function. For the life of me I can\'t figure out how to
ID: 3716478 • Letter: I
Question
In TSQL I just created a function. For the life of me I can't figure out how to call it. Show me how to call this function.
CREATE FUNCTION fn_MonsterCount
(@MonsterKey int, @GamerKey int)
RETURNS int
AS
BEGIN
DECLARE @class int
DECLARE @count int
SELECT @class = MonsterClassKey
FROM Monsters
WHERE MonsterKey = @MonsterKey
SELECT @count = COUNT(GM.GamerMonstersKey)
FROM Monsters M
INNER JOIN GamerMonsters GM
ON M.MonsterKey = GM.MonsterKey
WHERE GM.GamerKey = @GamerKey
RETURN @count
END;
My last 3 questions have been ignored and I have already figured out all 3 of them. This is a fairly simple question. If you don't have someone who can answer this question, I don't see any point paying for this account.
Explanation / Answer
SELECT fn_MonsterCount( 23,3 ) // function name and pass the parameters for it , this will works
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.