Hi Guys,
I have simple code in Arcpy to transfer attributes from one layer to another. It works for local gdb, but when i run it for SDE (It is versioned SDE connection) it stusks and do not import anything, i think it is problem of connection string i have, but i do not know how to change it. Here is a very useful code for transferring values between two layers, when one intersects to other, you can use it and help me for SDE connetion:
mxd = arcpy.mapping.MapDocument("Current")
Pointi = r'Database Connections\Connection to 10.0.151.30.sde\WaterTbilisi_GIS.DBO.kanalizacia\WaterTbilisi_GIS.DBO.canals'
Poli = r'Database Connections\Connection to 10.0.151.30.sde\WaterTbilisi_GIS.DBO.samisamarTo_erTeulebi\WaterTbilisi_GIS.DBO.done_6'
with arcpy.da.UpdateCursor(Pointi, ['SHAPE@','updateField']) as ucursor:
for update_row in ucursor:
with arcpy.da.SearchCursor(Poli, ['SHAPE@', 'TargetField']) as scursor:
for search_row in scursor:
if update_row[0].within(search_row[0]):
update_row[1] = search_row[1]
ucursor.updateRow(update_row)