insert into cw_terminal_2_door_state_definition (terminal_id, door_state_definition_id, deleted, version, date_created, last_updated, update_counter) select terminal_door_state_definitions_id, door_state_definition_id, 0, 0, getdate(), getdate(), 0 from cw_terminal_cw_door_state_definition