|
Perhaps dropping and re-creating MFD_ID and MFD_ID_X was done because this was easier than reciting all fields except MFD_ID. But I would argue that the query fragment for each table becomes semantically simpler even though the list of fields is long: --SQL9 SELECT * INTO temp FROM [1.1]::[1.1]; INSERT INTO temp ( [Geom], [X], [Y], [Z], [intensity], [return_number], [number_of_returns], [scan_direction_flag], [edge_of_flight_line], [classification], [scan_angle_rank], [user_data], [point_source_ID], [gps_time], [ScaledX], [ScaledY], [ScaledZ] ) SELECT [Geom], [X], [Y], [Z], [intensity], [return_number], [number_of_returns], [scan_direction_flag], [edge_of_flight_line], [classification], [scan_angle_rank], [user_data], [point_source_ID], [gps_time], [ScaledX], [ScaledY], [ScaledZ] FROM [1.2]::[1.2]; INSERT INTO temp ( [Geom], [X], [Y], [Z], [intensity], [return_number], [number_of_returns], [scan_direction_flag], [edge_of_flight_line], [classification], [scan_angle_rank], [user_data], [point_source_ID], [gps_time], [ScaledX], [ScaledY], [ScaledZ] ) SELECT [Geom], [X], [Y], [Z], [intensity], [return_number], [number_of_returns], [scan_direction_flag], [edge_of_flight_line], [classification], [scan_angle_rank], [user_data], [point_source_ID], [gps_time], [ScaledX], [ScaledY], [ScaledZ] FROM [1.3]::[1.3]; The query above merges data from 3 tables, I do SELECT INTO for the first one and INSERT / SELECT for the next two. This is also faster than dropping and re-creating fields and indexes. Also, the list of fields can be generated automatically using the query builder - drop one of the source tables into the query builder, right-click it and invoke Insert Field List, then you only have to remove MFD_ID from the list, and then it's all copy / paste / adjust name for the next table like before.
|