Hi
-> I(Admin) Assign the Task on Morning User and evening user .
->The morning shift have completed .three task pending in status( i attached the print screen image)
-> In morning Shift Pending Task Automatically assign the Evening Shift Of user
->using Sheduled job
->please send the the code
Thanks & regards
Selastin
Write job on sql server
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Khan Abrar AhmedRank #778 · 3K reputationPosted May 26, 2014, 11:56 PM EDT
DECLARE @Tasktable AS TABLE (taskid INT, taskstatus BIT, taskassignuserid INT)
INSERT INTO @Tasktable
( taskid ,
taskstatus ,
taskassignuserid
)
VALUES
( 1 , -- taskid - int
1 , -- taskstatus - bit
21 -- taskassignuserid - int
), ( 1 , -- taskid - int
0 , -- taskstatus - bit
21 -- taskassignuserid - int
), ( 1 , -- taskid - int
0 , -- taskstatus - bit
21 -- taskassignuserid - int
), ( 1 , -- taskid - int
0 , -- taskstatus - bit
21 -- taskassignuserid - int
)
SELECT * FROM @Tasktable AS t
--Creata job to schedule when the morning shift completed and the
UPDATE @Tasktable SET taskassignuserid=22 WHERE taskstatus=0
SELECT * FROM @Tasktable AS t
and create the job refer this link
http://www.c-sharpcorner.com/UploadFile/raj1979/create-and-schedule-a-job-in-sql-server-2008/
Jignesh TrivediRank #16 · 50.3K reputationPosted May 27, 2014, 12:11 AM EDT
hi,
Please refer below link it might help you.
http://msdn.microsoft.com/en-us/LIBRARY/ms190268(v=SQL.105).aspx
http://msdn.microsoft.com/en-us/library/ms191439(v=sql.100).aspX