Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote