Dear, how can I see the code to create a database view? For example, I have a UsrVwContactAddress view and I would like to get the creation code for that view in sql console:
CREATE VIEW dbo.UsrVwContactAddress AS SELECT...
Thanks!
Like
2 comments
15:02 May 06, 2021
Hi Sebastian,
Here are the example how you can do it:
Best Regards,
Bogdan L
01:53 May 07, 2021
If this is a cloud system, and you don't have access to local tools, you can use the following commands via SQL Executor to get the SQL for the view.
If database is MSSQL:
SELECT definition FROM sys.sql_modules WHERE object_id = object_id('viewname');
If database is Postgresql:
select pg_get_viewdef('"viewname"', true)
Ryan
Show all comments