IF EXISTS(
	SELECT * FROM sys.tables WHERE name = 'Timerjobs')
BEGIN	
	DROP TABLE Timerjobs;
END;

IF NOT EXISTS(
  SELECT * FROM sys.tables WHERE name = 'Timerjobs')
BEGIN	
	CREATE TABLE [dbo].[Timerjobs] (
		[Name] nvarchar(128)  NOT NULL,
		[Started] datetimeoffset  NOT NULL,
		[Ended] datetimeoffset  NOT NULL,
		[LastRunLog] nvarchar(max)  NOT NULL,
		[Enabled] bit  NOT NULL,
		[Status] int  NOT NULL
	);

	ALTER TABLE [dbo].[Timerjobs]
	ADD CONSTRAINT [PK_Timerjobs]
		PRIMARY KEY CLUSTERED ([Name] ASC);
END;