time_to_table_sp