sql and time related changes