DRAG DROP
You need to recommend the actions that are required to partition a table.
In which order should the four actions be performed?
To answer, move the actions from the list of actions to the answer area and arrange them in
the correct order.
Explanation:
create a partitioned table using the AdventureWorks2012 database:
CREATE PARTITION FUNCTION TransactionRangePF1 (DATETIME)
AS RANGE RIGHT FOR VALUES
(
‘20071001’, ‘20071101’, ‘20071201’, ‘20080101’,
‘20080201’, ‘20080301’, ‘20080401’, ‘20080501’,
‘20080601’, ‘20080701’, ‘20080801’
);
GOCREATE PARTITION SCHEME TransactionsPS1 AS PARTITION TransactionRangePF1
TO
(
[PRIMARY], [PRIMARY], [PRIMARY], [PRIMARY], [PRIMARY],
[PRIMARY], [PRIMARY], [PRIMARY], [PRIMARY], [PRIMARY],
[PRIMARY], [PRIMARY], [PRIMARY]
);
GO
CREATE TABLE dbo.TransactionHistory
(
TransactionID INT NOT NULL, — not bothering with IDENTITY here
ProductID INT NOT NULL,
ReferenceOrderID INT NOT NULL,
ReferenceOrderLineID INT NOT NULL DEFAULT (0),
TransactionDate DATETIME NOT NULL DEFAULT (GETDATE()),
TransactionType NCHAR(1) NOT NULL,
Quantity INT NOT NULL,
ActualCost MONEY NOT NULL,
ModifiedDate DATETIME NOT NULL DEFAULT (GETDATE()),
CONSTRAINT CK_TransactionType
CHECK (UPPER(TransactionType) IN (N’W’, N’S’, N’P’))
)
ON TransactionsPS1 (TransactionDate);
GO
Create filegropus
Create a partition function
Create a partition scheme
Create the table
Create filegroups
Create a partition function
Create a partition scheme
Create the table
https://msdn.microsoft.com/en-us/library/ms190787.aspx
[email protected]
https://msdn.microsoft.com/en-us/library/ms188730.aspx