Cannot read the data from a view, but can from the underlying tables.
Hello All, This sounds a bit wierd, but need some help in resolving this issue. I am a new DBA at our organization and having issues to read data from a view. This view was created by the BI team for reporting, which they say they can read the data but when i am trying to do the same i cannot fetch any rows at all, neither from VIEW or the SELECT query. Overview of the SQL view from the SELECT query. Reporting_view_name uses 4 other views & a table to populate the data Reporting_view_name - Cannot read the data VIEW1 - Cannot read the data VIEW2 - Cannot read the data VIEW3 - Can read the data TABLE1 - Can read the data VIEW4 - Can read the data VIEW1 uses 4 tables & 1 view and i can read the data from those 4 tables but not the view, and this view further uses two other tables and i can read the data from them as well. VIEW2 uses 4 tables and i can read from all 4 and 3 same which are being used in VIEW1 VIEW3 uses another VIEW to get data VIEW4 uses 2 tables to get the data Any ideas will be very helpful
Are there any WHERE-clauses in the views, filtering based on user_name(), suser_sname() function or similar? That's a common thing, that a view is created in a system, giving users only the rows they are allowed to see. And as a DBA, you are probably not configured to see data (since you can get the data directly from the tables directly anyway).
Yes @Usman i checked the script for the dependent views and how they were written but was not so impressed by them and suggested to tune them a bit or re-write again. Thanks for your help @Magnus Ahlkvist and @Usman Butt