How to recovery original SQL source from a view?

Hi!

Is possible to retrieve the original SQL that I used to create a view ? I need the original SQL exactly as I wrote, because the following sentence add a lot of schemas and quotation marks ( not incuded obviusly in my original SQL ) that makes it absolutely confused to read and modify in complex querys.

SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS
WHERE TABLE_NAME = ‘yourviewname’

Thanks in advance,
Regards

Hi,

Unfortunately, SHOW CREATE VIEW and INFORMATION_SCHEMA.VIEWS are the two ways to retrieve the view text, but both of them will show the same output (all column and table names escaped, etc.).

-Adam

1 Like