@RowFrom int
@RowTo int
are both Global Input Params for the Stored Procedure, and since I am compiling the SQL query inside the St
You can also get this error message if a variable is declared before a GOand referenced after it.
GO
See this question and this workaround.