How to create materialized views in SQL Server?

They’re called indexed views in SQL Server – read these white papers for more background:

  • Creating an Indexed View
  • Improving Performance with SQL Server 2008 Indexed Views

Basically, all you need to do is:

  • create a regular view
  • create a clustered index on that view

and you’re done!

The tricky part is: the view has to satisfy quite a number of constraints and limitations – those are outlined in the white paper. If you do this, that’s all there is. The view is being updated automatically, no maintenance needed.

Additional resources:

  • Creating and Optimizing Views in SQL Server
  • SQL Server Indexed Views

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)