CREATE TABLE [dbo].[Expressions]
(
[queryID] [int] NOT NULL,
[exprOrder] [int] NOT NULL,
[combiner] [nvarchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[openBracketCount] [int] NULL,
[closeBracketCount] [int] NULL,
[fieldID] [int] NULL,
[conditionID] [int] NULL,
[exprDate] [datetime] NULL,
[exprValue] [nvarchar] (500) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Expressions] ADD CONSTRAINT [fk_expressions_query] FOREIGN KEY ([queryID]) REFERENCES [dbo].[StoredQueries] ([queryID])
GO