I have a macro that I can run and loads data into a table as needed. However, when I call that Macro from a workflow, it fails. The input from the workflow to the macro is the same data that I am running the macro by itself.
The error message is
Data Quality Process (45) Record #1: PostSQLRuleResultsMacro (170): Record #1: Tool #2: Error opening "SELECT "RuleID","RuleRunID","ResultPrimaryKey","AsOfDate","MetricValue","ResultValue","VendorID","ProductID","SourceID","Environment","Input_#3_Environment","Input_#4_Environment","Source_Environment" FROM "DQ_RuleResults"": No Columns Returned.

The DQ_RuleResults table does not contain the columns: ,"Environment","Input_#3_Environment","Input_#4_Environment","Source_Environment"
Below is the Macro where this is failing.

The data that is being inserted is this

Please not there are no columns "Environment","Input_#3_Environment","Input_#4_Environment","Source_Environment" in the data being sent to the Output Data tool.
Why is there a select that runs that thinks these columns are part of the DQ_RuleResults table when the only columns in the table are the one's listed above from the Select tool.