Declare AND use parameter in advanced SQL

Within an advanced SQL I need to:

  • define a parameter as a specific list type;
  • insert values in it;
  • and then pass it on to a stored procedure as an input

The issue we have right now that service studio enforces you to also define that parameter as an input parameter of the advanced SQL. Though when trying to declare the parameter we get the error message: "The variable name '@qpstp_distr' has already been declared. Variable names must be unique within a query batch or stored procedure."

Anybody encountered this issue as well and found a solution?

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.