How can I Get Value of Max(col) in a greatest n per grouped by into Declared variable. MS SQL sever
how to set the value of @MaxItemSeqNum to the returned result


Either

SET @MaxItemSeqNum = ( SELECT MAX([Table1].[Item_Seq_number])
                       FROM Table1
                       WHERE Batch_Id = 1
                       Group By Batch_Id );


or

SELECT @MaxItemSeqNum = MAX([Table1].[Item_Seq_number])
                        FROM Table1
                        WHERE Batch_Id = 1
                        Group By Batch_Id;


fiddle

The last variant is more useful - it allows to assign the values to more than one variable in one statement.