I just created a view using below definition
create view dbo.dm_pdw_exec_requests_hist_view as
select t1.*,login_name,app_name,client_id from sys.dm_pdw_exec_requests t1
left outer join [sys].[dm_pdw_exec_sessions] t2 on
t1.request_id=t2.request_id
and the view was created successfully.
but I was not able to see the view in the SSMS tool [ Under views section]
and also - when I tried to query [INFORMATION_SCHEMA].[VIEWS] , there also i couldnt see a entry for the view dm_pdw_exec_requests_hist_view
select * from [INFORMATION_SCHEMA].[VIEWS]
But if I do select * from dm_pdw_exec_requests_hist_view ; it is returning the results as expected.
So - is there any restriction in viewing the definition of a view which contains DMVs in it ?
Thanks, Aravind
this is a very interesting case.
At first I thought maybe you're using an older version of SSMS, because I can see VIEWS in my SSMS. But then I tried to create your View and this one doesn't show up. Even querying sys.objects or sys.all_objects doesn't show that the View exists.
I have no idea what is going on here, but suggest you open a support case.
Markus