From 411854d20f70c060d301d74cd97dc733b3ddbbae Mon Sep 17 00:00:00 2001 From: Jos de Bruijn Date: Wed, 21 Jun 2017 10:12:07 -0700 Subject: [PATCH] facilitating publication to azure - removing explicit filegroup references from index definitions - adding snapshot hints to references for memory-optimized tables, to facilicate publication in DBs without the MEMORY_OPTIMIZED_ELEVATE_TO_SNAPSHOT hint --- .../Stored Procedures/RecordColdRoomTemperatures.sql | 6 +++--- .../wwi-ssdt/Purchasing/Tables/SupplierTransactions.sql | 2 +- .../wwi-ssdt/wwi-ssdt/Sales/Tables/CustomerTransactions.sql | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/samples/databases/wide-world-importers/wwi-ssdt/wwi-ssdt/DataLoadSimulation/Stored Procedures/RecordColdRoomTemperatures.sql b/samples/databases/wide-world-importers/wwi-ssdt/wwi-ssdt/DataLoadSimulation/Stored Procedures/RecordColdRoomTemperatures.sql index e807c513..ec45e69f 100644 --- a/samples/databases/wide-world-importers/wwi-ssdt/wwi-ssdt/DataLoadSimulation/Stored Procedures/RecordColdRoomTemperatures.sql +++ b/samples/databases/wide-world-importers/wwi-ssdt/wwi-ssdt/DataLoadSimulation/Stored Procedures/RecordColdRoomTemperatures.sql @@ -29,12 +29,12 @@ BEGIN DECLARE @Temperature decimal(10,2); -- clean up any artifacts from earlier runs - DELETE FROM DataLoadSimulation.[ColdRoomTemperatures_temp] + DELETE FROM DataLoadSimulation.[ColdRoomTemperatures_temp] WITH (SNAPSHOT) IF @TimeCounter < @TimeToFinishForTheDay BEGIN -- seed temporary table with current status of sensors - DELETE Warehouse.ColdRoomTemperatures + DELETE Warehouse.ColdRoomTemperatures WITH (SNAPSHOT) OUTPUT deleted.ColdRoomTemperatureID, deleted.ColdRoomSensorNumber, deleted.RecordedWhen, @@ -54,7 +54,7 @@ BEGIN EXEC DataLoadSimulation.PopulateColdRoomTemperatures_temp @AverageSecondsBetweenReadings, @NumberOfSensors, @TimeCounter, @ArchiveEndTime -- move daily data into archive table - DELETE DataLoadSimulation.ColdRoomTemperatures_temp + DELETE DataLoadSimulation.ColdRoomTemperatures_temp WITH (SNAPSHOT) OUTPUT deleted.ColdRoomTemperatureID, deleted.ColdRoomSensorNumber, deleted.RecordedWhen, diff --git a/samples/databases/wide-world-importers/wwi-ssdt/wwi-ssdt/Purchasing/Tables/SupplierTransactions.sql b/samples/databases/wide-world-importers/wwi-ssdt/wwi-ssdt/Purchasing/Tables/SupplierTransactions.sql index f3fb9b9e..f6c2d850 100644 --- a/samples/databases/wide-world-importers/wwi-ssdt/wwi-ssdt/Purchasing/Tables/SupplierTransactions.sql +++ b/samples/databases/wide-world-importers/wwi-ssdt/wwi-ssdt/Purchasing/Tables/SupplierTransactions.sql @@ -14,7 +14,7 @@ [IsFinalized] AS (case when [FinalizationDate] IS NULL then CONVERT([bit],(0)) else CONVERT([bit],(1)) end) PERSISTED, [LastEditedBy] INT NOT NULL, [LastEditedWhen] DATETIME2 (7) CONSTRAINT [DF_Purchasing_SupplierTransactions_LastEditedWhen] DEFAULT (sysdatetime()) NOT NULL, - CONSTRAINT [PK_Purchasing_SupplierTransactions] PRIMARY KEY NONCLUSTERED ([SupplierTransactionID] ASC) ON [USERDATA], + CONSTRAINT [PK_Purchasing_SupplierTransactions] PRIMARY KEY NONCLUSTERED ([SupplierTransactionID] ASC), CONSTRAINT [FK_Purchasing_SupplierTransactions_Application_People] FOREIGN KEY ([LastEditedBy]) REFERENCES [Application].[People] ([PersonID]), CONSTRAINT [FK_Purchasing_SupplierTransactions_PaymentMethodID_Application_PaymentMethods] FOREIGN KEY ([PaymentMethodID]) REFERENCES [Application].[PaymentMethods] ([PaymentMethodID]), CONSTRAINT [FK_Purchasing_SupplierTransactions_PurchaseOrderID_Purchasing_PurchaseOrders] FOREIGN KEY ([PurchaseOrderID]) REFERENCES [Purchasing].[PurchaseOrders] ([PurchaseOrderID]), diff --git a/samples/databases/wide-world-importers/wwi-ssdt/wwi-ssdt/Sales/Tables/CustomerTransactions.sql b/samples/databases/wide-world-importers/wwi-ssdt/wwi-ssdt/Sales/Tables/CustomerTransactions.sql index 400ffb96..de2726e7 100644 --- a/samples/databases/wide-world-importers/wwi-ssdt/wwi-ssdt/Sales/Tables/CustomerTransactions.sql +++ b/samples/databases/wide-world-importers/wwi-ssdt/wwi-ssdt/Sales/Tables/CustomerTransactions.sql @@ -13,7 +13,7 @@ [IsFinalized] AS (case when [FinalizationDate] IS NULL then CONVERT([bit],(0)) else CONVERT([bit],(1)) end) PERSISTED, [LastEditedBy] INT NOT NULL, [LastEditedWhen] DATETIME2 (7) CONSTRAINT [DF_Sales_CustomerTransactions_LastEditedWhen] DEFAULT (sysdatetime()) NOT NULL, - CONSTRAINT [PK_Sales_CustomerTransactions] PRIMARY KEY NONCLUSTERED ([CustomerTransactionID] ASC) ON [USERDATA], + CONSTRAINT [PK_Sales_CustomerTransactions] PRIMARY KEY NONCLUSTERED ([CustomerTransactionID] ASC), CONSTRAINT [FK_Sales_CustomerTransactions_Application_People] FOREIGN KEY ([LastEditedBy]) REFERENCES [Application].[People] ([PersonID]), CONSTRAINT [FK_Sales_CustomerTransactions_CustomerID_Sales_Customers] FOREIGN KEY ([CustomerID]) REFERENCES [Sales].[Customers] ([CustomerID]), CONSTRAINT [FK_Sales_CustomerTransactions_InvoiceID_Sales_Invoices] FOREIGN KEY ([InvoiceID]) REFERENCES [Sales].[Invoices] ([InvoiceID]),