indexed-views

Session setting to support indexed views

混江龙づ霸主 提交于 2019-12-06 14:12:45
I am using indexed views in my database. So client should have some session connection setting to call them. I am using ado.net connection, command to call stored procedures. Every time I have to call a stored procedure I create connection (I hope connection pool allows me to do this quickly) and execute a command to apply these settings to current connection. // some code to create a new connection //... //... if (connection.State != ConnectionState.Open) { connection.Open(); } using (var cmd = connection.CreateCommand()) { cmd.CommandType = CommandType.Text; cmd.CommandText = @" SET ANSI

How to create materialized views in SQL Server?

你。 提交于 2019-11-26 03:07:23
问题 I am going to design a DW and I heard about materialized views. Actually I want to create a view and it should update automatically when base tables are changed. Can anyone explain with an query example.. 回答1: 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