• Nice article! One problem, though.  It's generally considered a bad idea to use a named constraint on a temporary table. If there's an error before the temp table is dropped, the constraint can get stuck in TempDB and cause subsequent runs to fail with the error "There is already an object named 'PK0ByCell' in the database." Worse, the object does not show up in sys.objects, and cannot be dropped.  Just remove "CONSTRAINT PK0ByCell" and leave it as "PRIMARY KEY CLUSTERED...", and it will work properly.

    CREATE TABLE [#ByCell]([tiGuessNo]  TINYINT
            ,[tiRow]   TINYINT
            ,[tiCol]   TINYINT
            ,[tiBlk]   TINYINT
            ,[tiVal]   TINYINT
            ,[RowSetString] VARCHAR(9)
            ,[ColSetString] VARCHAR(9)
            ,[BlkSetString] VARCHAR(9)
            ,[Possibles]  VARCHAR(9)
            -- Get rid of these two words ====> ,CONSTRAINT [PK0ByCell]
            ,PRIMARY KEY CLUSTERED([tiGuessNo],[tiRow],[tiCol]))

    Further, I'd suggest using VARCHAR or CHAR instead of NVARCHAR, since all of the characters you'll be dealing with are single-byte.  Also, Try using the inline-IF (IIF()) function instead of a whole CASE block when there's only a single choice.  It makes the code shorter and easier to read. Like so:

    UpdateSetStrings:
    UPDATE [#ByCell]
    SET [RowSetString] = CAST([Val01] AS VARCHAR(1)) + CAST([Val02] AS VARCHAR(1)) + CAST([Val03] AS VARCHAR(1)) + CAST([Val04] AS VARCHAR(1)) + CAST([Val05] AS VARCHAR(1)) + CAST([Val06] AS VARCHAR(1)) + CAST([Val07] AS VARCHAR(1)) + CAST([Val08] AS VARCHAR(1)) + CAST([Val09] AS VARCHAR(1))
    FROM [#ByCell] AS [BC]
    INNER JOIN(SELECT
         [tiRow]
         ,MAX(IIF([tiCol] = 1,[tiVal],0)) AS [Val01]
         ,MAX(IIF([tiCol] = 2,[tiVal],0)) AS [Val02]
         ,MAX(IIF([tiCol] = 3,[tiVal],0)) AS [Val03]
         ,MAX(IIF([tiCol] = 4,[tiVal],0)) AS [Val04]
         ,MAX(IIF([tiCol] = 5,[tiVal],0)) AS [Val05]
         ,MAX(IIF([tiCol] = 6,[tiVal],0)) AS [Val06]
         ,MAX(IIF([tiCol] = 7,[tiVal],0)) AS [Val07]
         ,MAX(IIF([tiCol] = 8,[tiVal],0)) AS [Val08]
         ,MAX(IIF([tiCol] = 9,[tiVal],0)) AS [Val09]
        FROM [#ByCell]
        WHERE [tiGuessNo] = @tiGuess
        GROUP BY
         [tiRow]) AS [T] ON [BC].[tiRow] = [T].[tiRow]
    WHERE
     [tiGuessNo] = @tiGuess

    and similar for the Column/Row UPDATE below it.

    Doing these things shaved about 30 milliseconds off of the average runtime for me.