CREATE TABLE [dbo].[ATTrackingDefinitionTemplates] (
	[TrackingDefinitionId] INT NOT NULL,
	[TemplateId] INT NOT NULL,
	[Order] INT NOT NULL DEFAULT 0,
	[Description] NVARCHAR(255) NULL,
	CONSTRAINT PK_ATTrackingDefinitionTemplates PRIMARY KEY (TrackingDefinitionId, TemplateId),
	CONSTRAINT FK_ATTrackingDefinitionTemplates_TrackingDefinitionId FOREIGN KEY (TrackingDefinitionId) REFERENCES [dbo].[ATTrackingDefinition](Id),
	CONSTRAINT FK_ATTrackingDefinitionTemplates_TemplateId FOREIGN KEY (TemplateId) REFERENCES [dbo].[ATTemplates](Id)
);