﻿CREATE TABLE [dbo].[DataUpdate]
(
	[ID] INT IDENTITY(1,1) NOT NULL, 
    [SourceSystem] VARCHAR(50) NOT NULL, 
    [SourceData] VARCHAR(50) NOT NULL, 
    [TableName] VARCHAR(50) NOT NULL, 
    [StartDT] DATETIME NOT NULL, 
    [EndDT] DATETIME NOT NULL, 
    [UpdateType] SMALLINT NOT NULL, 
    [WasSuccessful] BIT NOT NULL, 
    [NumberRecords] BIGINT NOT NULL,
	CONSTRAINT [PK_DataUpdate] PRIMARY KEY CLUSTERED([ID])
)

GO

CREATE INDEX [IX_DataUpdate_LastUpdate] ON [dbo].[DataUpdate] ([TableName], [WasSuccessful], [StartDT] DESC)

GO