My earlier article SQL SERVER – The Limitations of the Views – Eleven and more… has lots of popularity and I have been asked many questions on the view. Many emails I received suggesting that they have hundreds of the view and now have no clue what is going on and how many of them have indexes and how many does not have index. Some even asked me if there is any way they can get a list of the views with the property of Index along with it.
Here is the quick script which does exactly the same. You can also include many other columns from the same view.
SELECT SCHEMA_NAME(schema_id) AS schema_name ,name AS view_name ,OBJECTPROPERTYEX(OBJECT_ID,'IsIndexed') AS IsIndexed ,OBJECTPROPERTYEX(OBJECT_ID,'IsIndexable') AS IsIndexable --,* FROM sys.views; GO
You can run above query to see if view is indexed or created with SCHEAMABINDING.
Do you use Views, if yes, you need to read SQL SERVER – The Limitations of the Views – Eleven and more…
Reference: Pinal Dave (http://blog.SQLAuthority.com)