Hallo Christa,
das sind die Tabellen
CREATE TABLE [dbo].[Variable] (
[VariableID] INT IDENTITY (1, 1) NOT NULL,
[VariableName] NVARCHAR (255) NOT NULL,
[VariableType] INT NOT NULL,
[IsDeleted] BIT NOT NULL,
[FlagUnique] BIT NOT NULL,
[FlagMandatory] BIT NOT NULL,
[FlagFreeUpdateAllVersion] BIT CONSTRAINT [DF__Variable__FlagFr__05EEBAAE] DEFAULT ((0)) NOT NULL,
[FlagFreeUpdateLatestVersion] BIT CONSTRAINT [DF__Variable__FlagFr__06E2DEE7] DEFAULT ((0)) NOT NULL,
CONSTRAINT [PK_Variable] PRIMARY KEY CLUSTERED ([VariableID] ASC)
);
CREATE TABLE [dbo].[VariableValue] (
[VariableID] INT NOT NULL,
[DocumentID] INT NOT NULL,
[ProjectID] INT NOT NULL,
[RevisionNo] INT NOT NULL,
[ConfigurationID] INT NOT NULL,
[ValueText] NVARCHAR (MAX) CONSTRAINT [DF_VariableValue_ValueText] DEFAULT (N'') NOT NULL,
[ValueInt] INT NULL,
[ValueFloat] FLOAT (53) NULL,
[ValueDate] DATETIME NULL,
[ValueCache] NVARCHAR (64) CONSTRAINT [DF_VariableValue_ValueCache] DEFAULT ('') NOT NULL,
[IsLongText] BIT CONSTRAINT [DF_VariableValue_IsLongText] DEFAULT ((0)) NOT NULL,
CONSTRAINT [PK_VariableValue] PRIMARY KEY CLUSTERED ([VariableID] ASC, [DocumentID] ASC, [ProjectID] ASC, [RevisionNo] ASC, [ConfigurationID] ASC) WITH (FILLFACTOR = 80),
CONSTRAINT [FK_VariableValue_DocumentConfiguration] FOREIGN KEY ([ConfigurationID]) REFERENCES [dbo].[DocumentConfiguration] ([ConfigurationID]),
CONSTRAINT [FK_VariableValue_Documents] FOREIGN KEY ([DocumentID]) REFERENCES [dbo].[Documents] ([DocumentID]),
CONSTRAINT [FK_VariableValue_Projects] FOREIGN KEY ([ProjectID]) REFERENCES [dbo].[Projects] ([ProjectID]),
CONSTRAINT [FK_VariableValue_Variable] FOREIGN KEY ([VariableID]) REFERENCES [dbo].[Variable] ([VariableID])
);
GO
CREATE NONCLUSTERED INDEX [IX_VariableValue_DocumentID]
ON [dbo].[VariableValue]([DocumentID] ASC) WITH (FILLFACTOR = 80);