Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!
WHILE (Select Max (sa.SlotID) From SlotAvailability as sa join AvailabilityType as at on sa.availabilityid = at.availabilityID WHERE sa.MachineID = @MachineID and sa.availabilityid = 1) >= @counter Begin --checks to see if the counter matches a slotId that exists for the selected machine, or null in this case --else moves on to the next slotID before any processing gets done. If ( select slotid from slotavailability where exists (select slotID from slotavailability Where @Counter in (Select SlotID from slotavailability where machineID = @machineID and availabilityid = 1))) is null Begin SET @Counter = @Counter + 1 End Else Begin Set @SlotTimeCounter = (select slottime from slot where slotId = @Counter) Insert Into @DateResults Values (@Counter,@SlotTimeCounter, 'Available') SET @Counter = @Counter + 1 End END END
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.