Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Queue Logic : FIFO ( Query should get a set of users from this table based on the date assign them to a week . Query should filtered by location in which the machine group is present. While assigning you have to check the validity if not valid ignore that user try the next user. The set of user that are updated will have updated date which is week start date in the queue table.

Tables
QueueTable (columns: Auditor, Location, Date)
machine(columns : machine_name,m_no,location)
group(columns:groupname,groupnumber,location ,shift)
weektable(today,weeek,week1,week2,week3)[week is current week,week1,is next to current week,week2 is next to week1,....soon]

help me to write queue or sugget me any other like procedure or service with reason

thanks in advance

Thanks&Regards
vamsi krishna
Posted
Comments
jvamsikrishna 30-Apr-12 6:27am    
Suggest me it is achivable in SP.
bbirajdar 30-Apr-12 6:43am    
Yes. This is achievable in SP. Go for it..
jvamsikrishna 2-May-12 5:08am    
Thank you for your suggestion

i had written that sp.
tirumalararao 30-Apr-12 7:11am    
ok
Corporal Agarn 1-May-12 10:25am    
Show what you have done so far

1 solution

SQL
create procedure sp_schedule
as declare @qid int
declare @loc varchar(30)
begin TRANSACTION tran1
select top 1 @qid = q_id,@loc=location from QueueTable  where
QueueTable.audit_date =(select  top 1 audit_Date from queuetable order by audit_Date asc)
update queuetable set audit_date=GETDATE() where @qid=q_id and @loc=Location
commit tran1
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900