Database Reference
In-Depth Information
PRIMARY KEY CLUSTERED
(
orderDate
, orderID
)
) ON example_yearlyDateRange_ps(orderDate);
Note Getting an error on the above syntax? Partitioning is a feature only available in
SQL Server Enterprise and Developer Editions. If you are not using Enterprise or
Developer Editions, you can comment out the partitioning in the last line
ON example_yearlyDateRange_ps(orderDate);
and replace it with
ON [Primary];
Next, you need to generate data using the T-SQL in Listing 8-3 . This is the data you
will be loading into PDW.
Listing 8-3 . Example of T-SQL Code to Populate a Table with Sample Data
/* Declare variables and initialize with an arbitrary
date */
DECLARE @startDate DATETIME = '2013-01-01';
/* Perform an iterative insert into the FactSales table */
WHILE @startDate < '2016-01-01'
BEGIN
INSERT INTO PDW_Example .dbo.FactSales (orderDate,
customerID )
SELECT @startDate
, DATEPART(WEEK, @startDate ) + DATEPART(HOUR,
@startDate );
/* Increment the date value by hour; for more test
 
 
Search WWH ::




Custom Search