Skip to content

Commit f89aa1f

Browse files
authored
Merge pull request #725 from joesackmsft/patch-1
Updated script based on feedback
2 parents 412cd11 + f377de8 commit f89aa1f

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

samples/features/intelligent-query-processing/Intelligent QP Demo - Interleaved Execution.sql

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77

88
-- This demo is on SQL Server 2017 and Azure SQL DB
99

10+
-- Last updated 1/29/2020 (Credit: Milos Radivojevic)
11+
-- Changed @event to varchar(30) from varchar(15)
12+
-- Added date range to 'Mild Recession' branch
13+
1014
-- Email IntelligentQP@microsoft.com for questions\feedback
1115
-- ******************************************************** --
1216

@@ -17,7 +21,8 @@
1721
USE [WideWorldImportersDW];
1822
GO
1923

20-
CREATE OR ALTER FUNCTION [Fact].[ufn_WhatIfOutlierEventQuantity](@event VARCHAR(15), @beginOrderDateKey DATE, @endOrderDateKey DATE)
24+
CREATE OR ALTER FUNCTION [Fact].[ufn_WhatIfOutlierEventQuantity]
25+
(@event VARCHAR(30), @beginOrderDateKey DATE, @endOrderDateKey DATE)
2126
RETURNS @OutlierEventQuantity TABLE (
2227
[Order Key] [bigint],
2328
[City Key] [int] NOT NULL,
@@ -48,6 +53,7 @@ BEGIN
4853
FROM [Fact].[Order] AS [o]
4954
INNER JOIN [Dimension].[City] AS [c]
5055
ON [c].[City Key] = [o].[City Key]
56+
WHERE [o].[Order Date Key] BETWEEN @beginOrderDateKey AND @endOrderDateKey
5157

5258
IF @event = 'Hurricane - South Atlantic'
5359
INSERT @OutlierEventQuantity

0 commit comments

Comments
 (0)