I want to add a sql view, generated in slq server, on ArcMap document, through python script.
My sql view has this fields:
My script is:
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd,"Layers")
lyr = arcpy.mapping.Layer(r'Database Connections\xxxxx.sde\xxxx.dbo.Lay1')
This script load lyr on ArcMap temporaly, but when I want to acces to Attribute table, see this error:
I don´t know how to indicate to python, wich field from Lay1 contain oid, in my case OBJECTID field.
I guess your help, thanks.