The views are in XYZ production database and user needs the list of indexes on the tables on which the views has been created.
Please help me with query to find list of indexes on the tables on which the views has been created.
Technology Tips and News
The views are in XYZ production database and user needs the list of indexes on the tables on which the views has been created.
Please help me with query to find list of indexes on the tables on which the views has been created.
Declare @viewName varchar(100)='schema.viewname' Declare @tbls table(name varchar(100),type varchar(50),updated varchar(10),selected varchar(10),columnname varchar(100)) insert into @tbls exec sp_depends @viewName Select distinct a.name Table_name,i.name Index_Name from @tbls a join sys.tables t on a.name like '%'+t.name join sys.indexes i on t.object_id=i.object_id
Thanks for your post
But its not giving any results , I want to find the tables and Indexes used by View(I mean dependent)