If you’re getting SQL Server error 137 that goes something like “Must declare the scalar variable…“, it’s probably because you’re referring to a variable that hasn’t been declared.
If the variable has been declared, it’s possible you’re referring to it incorrectly in the code.
When we use a variable in SQL Server, we must declare the variable first.
To fix this issue, declare the variable. Also be sure to use the right syntax when using it.
Continue reading