Community Halloween is live until October 31st! Complete any 2 quick activities to earn the 2025 Community Halloween badge. Feeling brave? Check out the activities here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Struggling to Read and Execute .SQL file (TSQL)

CDunhill
8 - Asteroid

Starting with file path to a .sql file, I'm trying to read the query and execute using Dynamic Input.

 

In Dynamic Input I have connected to the DB and entered a dummy query eg. 'replaceme' (no quotes) and I'm trying to replace THAT with my query (in [Query] field) using 'Replace a Specific String'

 

However I'm getting the following errors:

 

Error: Dynamic Input (14): Error SQLExtendedFetch: [Microsoft][ODBC Driver 17 for SQL Server]Invalid cursor state

Info: Dynamic Input (14): Alias translated to odbc:DRIVER={ODBC Driver 17 for SQL Server};DATABASE=DataWarehouse;SERVER=MWSQL;Trusted_Connection=yes|||replaceme

Info: Dynamic Input (14): ODBC Driver version: 03.80

Dynamic Input (14) Error opening "SELECT * FROM "replaceme"": No Columns Returned.

 

Any idea what I am doing wrong? I've a sneaking suspicion I'm making a schoolboy error...? :D

 

CDunhill_0-1649245190346.png

 

 

 

5 REPLIES 5
mceleavey
17 - Castor
17 - Castor

Hi @CDunhill ,

 

can you provide the file so we can see what you're trying to do?

 

M.



Bulien

CDunhill
8 - Asteroid

I think you should be able to use any .SQL file? The problem seems to be with the Dynamic Input rather than the file itself.

 

The code in the above is a two line test query 'use datawarehouse Select top(10) code from branches', and I'm happy the output from the Summarize tool works ok (it concatenates multiple rows into one record using \n separator). You can see this in the screenshot too.

CDunhill
8 - Asteroid

Are you able to make it run with a .sql file of yours?

CDunhill
8 - Asteroid

More screen grabs:

 

Summarize output to [Query]

CDunhill_0-1649252470012.png

 

Dynamic Input config:

CDunhill_1-1649252535215.png

 

Unedited query in Dynamic Input:

CDunhill_2-1649252613668.png

 

CDunhill
8 - Asteroid

I'm not getting much traction from this post (my bad) so I think I might re-state my requirements elsewhere - thank you.

Labels
Top Solution Authors