We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Can I extract the SQL table name as a variable and populate the filename with it?

aliensurfer
7 - Meteor

I have to run MS SQL database extracts for more than 200 tables with each table's data going into its own Excel file. Is there a way for me to dynamically extract the table name from the Metadata Source column as a variable and inject it into the filename instead of me having to hard-code each table name in the Output tool?

 

Thanks.

3 REPLIES 3
apathetichell
20 - Arcturus

Hello @aliensurfer would you like to meet my friend Dynamic Output In-DB. It can extract query data from your SQL query.

aliensurfer
7 - Meteor

Hello @apathetichell yes I would love to meet your friend. Would you have an example of how I could use it? Thanks.

apathetichell
20 - Arcturus

Hi! Dynamic Output-In-DB can be set to export your query as a field. You can then use the awesome power of REGEX to parse out your table name based upon matching the db (or schema) identifier or db format ie (regex_replace([query],".*\s(\w+\.\w+)\s.*","$1") or something (note \w+\.\w+\.\w+ potentially for snowflake and you may need to make accomodations for quotes and underscores.

Labels
Top Solution Authors