-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathExtendedAttributes.sql
23 lines (23 loc) · 1.14 KB
/
ExtendedAttributes.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--------------------------------------------------------------------------------------------------------------------------------
-- EXTENDED ATTRIBUTES (TABLE)
--------------------------------------------------------------------------------------------------------------------------------
-- Provides a storage AttributeXml (in XML format) for attribute key/value pairs. Attributes can also be stored in the
-- Attributes table. The difference is that the latter limits attribute values to 255 characters per AttributeValue,
-- whereas the AttributeXml offers virtually unlimited storage capacity (at least in practical terms).
--------------------------------------------------------------------------------------------------------------------------------
CREATE
TABLE [dbo].[ExtendedAttributes] (
[TopicID] INT NOT NULL,
[AttributesXml] XML NOT NULL,
[Version] DATETIME2(7) NOT NULL DEFAULT SYSUTCDATETIME(),
CONSTRAINT [PK_ExtendedAttributes] PRIMARY KEY CLUSTERED (
[TopicID] ASC,
[Version] DESC
),
CONSTRAINT [FK_ExtendedAttributes_Topics]
FOREIGN KEY ( [TopicID]
)
REFERENCES [dbo].[Topics] (
[TopicID]
)
);