MySQL:
SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS
WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME = 'v';
reference:Tabulka INFORMATION_SCHEMA VIEWS
SQL Server:
USE databasename
GO
EXEC sp_helptext viewName
nebo také dotaz, jako je tento:
SELECT TABLE_NAME as ViewName,
VIEW_DEFINITION as ViewDefinition
FROM INFORMATION_SCHEMA.Views
kam byste mohli přidat WHERE
načíst pouze jeden pohled