Created
May 3, 2012 22:05
-
-
Save cbcwebdev/2589867 to your computer and use it in GitHub Desktop.
Modern Directory Table Structure
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE [dbo].[Directories] | |
( | |
[AggregateId] UNIQUEIDENTIFIER NOT NULL, | |
[Name] NVARCHAR(64) NOT NULL, | |
[Route] NVARCHAR(128) NOT NULL UNIQUE, | |
[Route_Hash] AS CAST(HASHBYTES('SHA1', [Route]) AS VARBINARY(20)) PERSISTED UNIQUE, | |
[Depth] TINYINT NOT NULL, | |
[ParentId] UNIQUEIDENTIFIER NULL, | |
CONSTRAINT [PK_Directories] PRIMARY KEY NONCLUSTERED ( | |
[AggregateId] ASC | |
) | |
) | |
GO | |
CREATE CLUSTERED INDEX [CX_Directories_AggregateId_ParentId_Depth] | |
ON [dbo].[Directories] (AggregateId ASC, ParentId ASC, Depth ASC); | |
GO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment