Dear All,I am facing a problem in creation of trigger. Am having 2 tables named as:Availability-------------------ID | Name | Status-------------------1 | John | 12 | Lama | 03 | Anny | 0-------------------User_Available----------ID | Name----------1 | Lama 2 | Anny ----------
I want to write a trigger, where it'll check the Status from Availability as 0 and update the User_Available table. This is simple Query:select top 1 Name from Availability where Status = 0
But if the situation comes that all the Names' status is 1, then trigger should insert Name in User_Available according to the Ascending Order of the ID.E.g.: If all status is 1 in Availability, then John name should be updated as his ID is 1 and in ascending order.Availability-------------------ID | Name | Status-------------------1 | John | 12 | Lama | 13 | Anny | 1-------------------User_Available----------ID | Name----------1 | John ----------
Hope I can make you understand my query?Regards,DaipayanSoftware Programmer
Application has reported a 'Not My Fault' in module KRNL.EXE in line 0200:103F