# #tableau | What does custom sql in Tableau Prep export to database option do? #analytics #data

> This is content from just-tim, the data-and-analytics channel by Tim Ngwena (formerly 'Tableau Tim'). Tim has 12+ years of hands-on BI experience and covers Tableau most of all, plus Power BI, Looker, Hex, SQL and data modelling, the analytics industry, and the craft of doing the job — always tool-agnostic and honest about the trade-offs.

- **Author:** Tim Ngwena (just-tim, https://just-tim.com/about)
- **Published:** 2023-02-06
- **Format:** Short · 1 min watch · transcript available
- **Topics:** Data prep
- **Tools:** SQL; Tableau (custom sql, prep)
- **Canonical:** https://just-tim.com/posts/tableau--what-does-custom-sql-in-tableau-prep-export-to-database-option-do-analytics-data
- **Watch:** https://www.youtube.com/watch?v=jNnIF0b5ptc

I answer a viewer's question about the custom SQL option within the export to database step in Tableau Prep. It lets you run custom SQL before, after, or both when writing to a database.

## Key takeaways

- The export to database option in Tableau Prep includes a custom SQL feature
- Custom SQL can be run before writing, after writing, or both
- This gives you control over database operations around the write step in Prep

Watch the full video, read the transcript and use chapter deep-links on the page: https://just-tim.com/posts/tableau--what-does-custom-sql-in-tableau-prep-export-to-database-option-do-analytics-data

---
just-tim — Data and analytics, with a point of view. · https://www.youtube.com/channel/UC7HYxRWmaNlJux-X7rNLZyw · https://twitter.com/TableauTim · https://www.linkedin.com/in/timngwena
