delete AutomatedTaskInstanceStatus
go

alter table [AutomatedTaskInstanceStatus]
      add [ScheduleID] int  null
go
/*
alter table [AutomatedTaskInstanceStatus]
    add
		constraint AutomatedTaskInstanceStatus_Schedule_FK foreign key (ScheduleID)
			references Schedule(ScheduleID)
*/

alter  table [AutomatedTaskInstanceStatus]
      alter column [ScheduleID] int  not null
go