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 very odd. I'm able to repo your behavior that the view doesn't show up in our DMVs (sys.objects or sys.views). This is the defect as SSMS which uses those views isn't aware of it. I do see that creating and then running the view works (sample below) so functionally this is working. I also tried renaming the view to dbo.Matt (creative, I know) and this worked. I've filed a defect to figure out the reserved name issue and we can document this for now.