I really like how the new data viewer in version 16 shows hints for ExecuteSql statements that are not working correctly. However in trying to track down a problem with a script I came across this, and I am not sure what it means.
Notice the column name referenced in the SELECT statement is for 'sep2011invoice', but the result seems to indicate the SELECT is looking for a column of a completely different name 'Dec13OrientationGoingPlaces'. I closed the file thinking it was a one-off error, but it reappeared with a column name entirely different from the first two.
Lastly, I completed removed the column name from the statement and it did not affect the results. It appears that the data viewer is ignoring the column name referenced in the ExecuteSql statement for a column name that was dynamically generated in a script as a local variable even after the script has ended. But how can that be?
This could explain the abnormalities with the script results, but I am at a loss to explain the explanation provided in the results section of the data viewer. And could my hypothesis be correct about referencing a column name stored in a local variable from a script that has ended?