Yeah you got me right,say you table is like following of room_master
Room_master
----------------
ID roomId isBooked
-------------------------
1 1 0
2 2 0
3 3 1
4 4 1
above you can see room with id 1 and 2 are available and 3 and 4 are allocated so before allocating the room just check with the roomId like following
SELECT isBooked FROM Room_Master WHERE RoomId=@RoomId
so this will give you flaged value for perticuler room which you are trying to book
let me know
thxs