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
Loading
Jignesh TrivediPosted May 27, 2014, 4:11 AM
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
Khan Abrar AhmedPosted May 27, 2014, 3:56 AM
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/