DROP TABLE IF EXISTS SupportEvent;
GO
CREATE TABLE SupportEvent
(
SupportEventId int not null identity(1,1)
PRIMARY KEY NONCLUSTERED,
StartDateTime datetime2 not null,
CustomerName nvarchar(16) not null,
SupportEngineerName nvarchar(16) null,
...
)
WITH (
MEMORY_OPTIMIZED = ON,
DURABILITY = SCHEMA\_AND_DATA);
GO
ALTER TABLE SupportEvent
ADD CONSTRAINT constraintUnique_SDT_CN
UNIQUE NONCLUSTERED
(StartDateTime DESC, CustomerName);
GO
ALTER TABLE SupportEvent
ADD INDEX idx_hash_SupportEngineerName
HASH (SupportEngineerName)
WITH (BUCKET_COUNT = 64);
GO