Inputting and running SQL.. but through Alteryx
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi,
I have a problem in that I have a bunch of SQL codes which I run in Visual Studio and get results; I want to include these in an Alteryx Workflow and run them through Alteryx, but so that if I edit my SQL code outside of Alteryx, Alteryx will run the updated code (without copying and pasting each time I edit).
Example:
I have a SQL code: SELECT top 10 * FROM [red].[pink]
How do I input this into Alteryx?
How do I run this query through Alteryx?
How do I change my SQL code in SQL, where this changes within Alteryx too?
Note: I have read previous solutions to similar questions but as quite a new user I have not understood, or they were not quite the same question and so the answer did not relate well.
Thank you!
Solved! Go to Solution.
- Labels:
- Help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @Elizabeth,
To do this, you can use a Input tool and select either Microsoft SQL Server... or Other Data Connections > OleDb... in the Input Tool's config panel. In the ensuing dialogs, you can supply connection information for your database.
Once you are connected, you can go to the "SQL Editor" tab and enter your raw SQL code there. If you like SSQL, you can also check a box in the lower left to "Open SQL Editor view by default." PS, if you don't see the Query Editor upon connecting, click the ellipsis on the "Table or Query" row of the Input tool's config panel.
Hope that helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi John,
You have mentioned to enter the raw SQL code into SQL Editor; one of my problems is that this code will be changing and I would like to be able to input this code automatically from an external source.
Does this make any sense?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @Elizabeth,
Thanks for clarifying. Yes, they do have a Dynamic Input tool, and for that you can supply a connection and some raw SQL, and then replace that SQL with whatever you want at run-time. For that, basically I supply a dummy string SQL query string like ReplaceMe, and nothing else. Then choose "replace a specific string" in the config panel, and replace "ReplaceMe" with the input being passed in. Of course, you can be as specific as you want: if you're just modifying a portion of your query, you can target just that portion of the query for replacement.
Hope that helps!
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
That sounds right, I'll have a go!
Thank you
