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.
Hello @aliensurfer would you like to meet my friend Dynamic Output In-DB. It can extract query data from your SQL query.
Hello @apathetichell yes I would love to meet your friend. Would you have an example of how I could use it? Thanks.
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.