Hi I have a SQL query and am able to run the query in SQL studio. However while running in Alteryx both in input tool and connect -in DB tool am getting error. Can you please help. How to configure SQL query with declare variable
Query example:
--The query has a declare statement
declare @input_date as varchar(10)
SET @input_date = '20230723'
--and in the rest of the query am trying to drop a table if it exists and create a table then do call the above declared variable in the query
you can drop a table in pre/post sql in an input data tool. I do not believe you can declare/set in those tools - and you definitely cannot in In-DB work. You would reconfigure this in Alteryx where you used other logic to set and test your parameters.