Hi,
I have a similar situation as in the following code where i want to materialize future due orders to avoid excessive reads in the procedure which at the moment i am handling using co-related sub-queries or even APPLY.
So what is the alternate option available to avoid excessive reads from table in every query and in many SPs wherever i need to use this logic?
Thanks.
I have a similar situation as in the following code where i want to materialize future due orders to avoid excessive reads in the procedure which at the moment i am handling using co-related sub-queries or even APPLY.
USE[AdventureWorks2012]-- SQL 2012 Std EditionGO--CREATE VIEW Sales.future_order_Due_Date--WITH SCHEMABINDING--ASSELECT[CustomerID],[SalesPersonID],MIN([OrderDate])AS OrderDate,MIN([DueDate])AS DueDate,MIN([ShipDate])AS ShipDateFROM[Sales].[SalesOrderHeader]GROUPBY[CustomerID],[SalesPersonID]HAVINGMIN([DueDate])>'2007Jan01'--getdate()
So what is the alternate option available to avoid excessive reads from table in every query and in many SPs wherever i need to use this logic?
Thanks.
For quick review of new features, try virtual labs: http://msdn.microsoft.com/en-us/aa570323