/****** Durable feed queue ******/ /* The connector creates this automatically if its DB account has CREATE TABLE permission. */ /* Run this script manually when the connector account is not allowed to run DDL, */ /* together with AddRecoveryKeyToTCDProcessStatus.sql for the TCD cursor columns. */ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO /* Records read from TCD, waiting to be delivered to StandardSurvey or ECM */ /* Status: PENDING -> SENDING -> DONE / FAILED. Finished rows are purged after 7 days. */ IF OBJECT_ID('dbo.TCDFeedQueue', 'U') IS NULL BEGIN CREATE TABLE [dbo].[TCDFeedQueue]( [Id] [bigint] IDENTITY(1,1) NOT NULL, [RecoveryKey] [float] NOT NULL, [FeedType] [varchar](10) NOT NULL, [Status] [varchar](10) NOT NULL, [OwnerId] [varchar](100) NULL, [Attempts] [int] NOT NULL DEFAULT 0, [LastHttpStatus] [int] NULL, [CreatedTime] [datetime] NOT NULL DEFAULT GETDATE(), [UpdatedTime] [datetime] NOT NULL DEFAULT GETDATE(), [ANI] [varchar](32) NULL, [DigitsDialed] [varchar](40) NULL, [AgentSkillTargetID] [varchar](50) NULL, [Skill_Group] [varchar](255) NULL, [RouterCallKeyDay] [varchar](50) NULL, [RouterCallKey] [varchar](50) NULL, [DateTime] [datetime] NULL, [Variable1] [varchar](40) NULL, CONSTRAINT [PK_TCDFeedQueue] PRIMARY KEY CLUSTERED ( [Id] ASC )) ON [PRIMARY] CREATE UNIQUE NONCLUSTERED INDEX [UX_TCDFeedQueue_RecoveryKey_FeedType] ON [dbo].[TCDFeedQueue] ([RecoveryKey], [FeedType]) CREATE NONCLUSTERED INDEX [IX_TCDFeedQueue_Status] ON [dbo].[TCDFeedQueue] ([Status], [FeedType], [Id]) END GO