/*   this works only for Express

update AutomatedTaskDeviceLink 
   set ScheduleID = (
                       select ScheduleID
                         from AutomatedTask at
                        where at.AutomatedTaskID = AutomatedTaskDeviceLink.ScheduleID
                    )

*/

update AutomatedTaskDeviceLink 
   set 
       ScheduleID = @ScheduleID
 where 
      AutomatedTaskID = @AutomatedTaskID

