2

I am creating a relationship class inside an SDE Environment (SQL Server 2016).

I have a point feature class and a related table.

I am trying to add rows to the currently empty table based off specific features from my point feature class.

the only way I see to do this is start an edit session, select all my points and open the attribute editor window then select the feature, use the drop down, right click the table and select "add new".

I have several thousands points I need to do this for, is there a bulk option or a way to automate this process? enter image description here

My keys in the origin table is GlobalID, the key field in destination table is a GUID field type named "Parent_GUID"

  • Populate original with relevant key and append related table. – FelixIP Aug 22 '18 at 19:24
  • can you expand on this, not sure what you mean – NULL.Dude Aug 22 '18 at 20:17
  • What are the names and types of keys in relationship? I can post solution using them, that will work in fgdb, no experience with sde though. – FelixIP Aug 22 '18 at 20:45
  • I edited my original question to answer your latest inquiry @FelixIP – NULL.Dude Aug 22 '18 at 20:50
2

Original tables:

enter image description here

Table to be appended to FLOORS:

enter image description here

Add fields from FLOORS to fromEXCEL table:

enter image description here

and populate newly added fields:

arcpy.CalculateField_management("fromExcel", "FLOOR_DESCRIPTION", "[FLOOR]")
arcpy.CalculateField_management("fromExcel", "BUILDING_ID","[BUILDING]")
arcpy.AddJoin_management("fromExcel", "BUILDING", "BUILDINGS", "GISBUILDING","KEEP_ALL")
arcpy.CalculateField_management("fromExcel", "fromExcel.Parent_GUID", "[BUILDINGS.GlobalID]")

Remove join and original fields to make schemas between fromEXCEL and FLOORS match:

arcpy.DeleteField_management("fromExcel", "BUILDING;FLOOR")

and append fromEXCEL to FLOORS:

arcpy.Append_management("fromExcel", "FLOORS", schema_type="TEST")

Spot check:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.