Bug: Must declare the scalar variable "@pv"Possible Solution
The problem seems to be associated with the declaration that is missing from the batch scope.
I am 99% sure that this "Batch13" is executed out of scope.
This happens a lot in our scripts since they contain large number of binary data updates.
You should insert the declaration dynamicaly when the exes are running the scripts, right after the first batch.