When creating an SDE View in ArcSDE 10.4 between a FC and a table. How is the field OBJECTID used?
The OBJECTID field in a SDE View is a long integer not an OBJECT ID type. So when I copy the SDE view to another Geodatabase it adds a new field OBJECTID_1 in the new feature class, this one has data type Object ID.
Until ArcGIS 10.2 we created SDE Spatial views with the command line, and they worked fine:
sdetable -o create_view -T ProjectInfo -t "Project, Project_Table"
-c "Project.SHAPE, Project.OBJECTID, Project.ProjectID, Project_Table.DATEOFFERED, Project_Table.DATEEXECUTED, Project_Table.Project_STATUS,Project_Table.PROJECTNAME"
-a "SHAPE, OBJECTID, ProjectID, DateOFFERED, DateEXECUTED,STATUS, PROJECTNAME" -w "Project.ProjectID IS NOT NULL AND Project.ProjectID = Project_Table.ProjectID"
Now in ArcGIS 10.4 we are creating SDE Spatial Views directly in ArcCatalog and the OBJECTID field has some issues
CREATE VIEW ProjectInfo AS SELECT Project_Table.OBJECTID, Project.SHAPE, Project.ProjectID, Project_Table.ProjectSTATUS AS STATUS ,Project_Table.DATEOFFERED, Project_Table.DATEEXECUTED, Project_Table.PROJECTNAME FROM Project INNER JOIN Project_Table ON Project.ProjectID = Project_Table.ProjectID WHERE (NOT (Project.ProjectID IS NULL))
What does not work when you do not choose an object id?
There is no need to select the objectid, but keep in mind ArcMap uses a unique, not null field to sort, identify, select and display the data properly.
For example, using the counties feature class in the ArcDesktop template data folder (C:\Program Files (x86)\ArcGIS\Desktop10.<your version>\TemplateData), I create a new test view.
select NAME from counties;
Adding this view to ArcMap I am prompted to choose my unique column. The only column I have to choose from is NAME. The query layer is then added with only unique name values. Therefore, the query layer in ArcMap will filter out all duplicate name values.