Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

Local SQL Variables not working in Alteryx

adam32291
5 - Atom

Hello everyone, 

 

I am having issues running a SQL Server query in Alteryx. My assumption is that it is related to the local variables that were created by the developer and Alteryx not being able to read in those variables. 

 

Is there a proper way to get those variables written in so the data runs through Alteryx?

 

Is the correct way to place the variable portion of the query in the "PRE SQL Statement" section and the entire query in to the "Table or Query" section?

 

Any help would be appreciated. 

 

Thanks.

2 REPLIES 2
c-lopez
Alteryx Alumni (Retired)

Hi @adam32291,

 

Yes you can add a Pre-SQL statement to your connections. Under options on the configuration panel of the input source in question take a look at option 9, it allows you to add a statement, further option 11 gives you the ability to add a Post-SQL statement

c-lopez_0-1594932474828.png

 

adam32291
5 - Atom

Thank you. I tried this, but unfortunately still getting an error. Invalid cursor state and an error executing PostSQL

 

Does any of the below SQL look incorrect in declaring variables?

 

adam32291_0-1594932777474.png

 

Labels