查看视图原始sql

sqlserver 

sp_columns view_1

select 
视图名=object_name(id),
相关表名=object_name(depid),
对应字段名=(select name from syscolumns where id=depid and colid=depnumber)
from sysdepends where objectproperty(id,'IsView')=1
order by id
 

sp_helptext view_1



ORACLE

select view_name from all_views; 系统视图

 select view_name from user_views;用户视图

你可能感兴趣的:(SQL,视图,sql)