How can you get a list of the views in a SQL server database that have indexes (i.e. indexed views)?
I've found it's pretty easy to run an "ALTER VIEW" as I'm developing and overlook that I'm not only editing the view but also dropping an existing index. So I thought it would be nice to have a little utility query around that would list me off all the views with indexes.
SELECT o.name as view_name, i.name as index_name
FROM sysobjects o
INNER JOIN sysindexes i
ON o.id = i.id
WHERE o.xtype = 'V' -- View