I have a query in the SQL 2005 server we use for archive retrieval and a similar query in our 2019 box works with no issue.
Declare @POnumber varchar(max) = '6801415970'
SELECT * FROM dbo.SA15 WHERE PONO = /*'6801415970'*/ @POnumber
SELECT * FROM dbo.SA15B WHERE PONO = /*'6801415970'*/ @POnumber
SELECT TOP 100 * FROM SA15
Msg 139, Level 15, State 1, Line 0
Cannot assign a default value to a local variable.
Msg 137, Level 15, State 2, Line 3
Must declare the scalar variable "@POnumber".
Msg 137, Level 15, State 2, Line 6
Must declare the scalar variable "@POnumber".