• What do you see when you stare & compare?

    SELECT

    LKC.combo, lockCombo1

    FROM [Inputtb] A

    JOIN test.dbo.School SCH

    ON A.schoolnumber = SCH.type

    and A.schoolnumber = @SchoolNumber

    JOIN test.dbo.Locker LKR

    ON SCH.schoolID = LKR.schoolID

    AND A.lockerNumber = LKR.number

    and LKR.schoolID = @SchoolID

    JOIN test.dbo.Lock LK

    ON LKR.lockID = LK.lockID

    JOIN test.dbo.LockCombination LKC

    ON LK.lockID = LKC.lockID

    WHERE LKC.seq = 1

    --AND LKC.combo <> lockCombo1

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden