3

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"

asked Aug 22, 2018 at 18:26
4
  • Populate original with relevant key and append related table. Commented Aug 22, 2018 at 19:24
  • can you expand on this, not sure what you mean Commented Aug 22, 2018 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. Commented Aug 22, 2018 at 20:45
  • I edited my original question to answer your latest inquiry @FelixIP Commented Aug 22, 2018 at 20:50

1 Answer 1

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

answered Aug 22, 2018 at 21:57

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.