{"id":83,"date":"2019-12-11T19:27:14","date_gmt":"2019-12-11T19:27:14","guid":{"rendered":"http:\/\/www.sqlgeometry.com\/?p=83"},"modified":"2019-12-11T21:09:26","modified_gmt":"2019-12-11T21:09:26","slug":"arcgispro-choosing-an-objectid-then-losing-it","status":"publish","type":"post","link":"https:\/\/www.sqlgeometry.com\/?p=83","title":{"rendered":"ArcGISPro choosing an ObjectID from a view. Then losing it."},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>The workflow is simple:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Create a view to filter the data in the database<\/li><li>Add the view to catalog in ArcGIS Pro<\/li><li>Extract the data to a staging table<\/li><li>Add the table to the map (note: why cant I work on the data in the catalog without adding to the map?)<\/li><li>Perform work &#8211; lots of GIS functions add and remove columns, perform field calculations.  Note: if you haven&#8217;t tried the field calculation  functionality in QGIS you should, its really good.<\/li><li>Finally, join the the data back to the source and use a sql update script to update the source data.<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>So whats the problem?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">As I am working though the process of using this table in the ESRI platform, it drops the identity field, <strong>and leaves me without a key to join back to my source data<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">ESRI identifies that there is a column that is an identity with unique values and guaranteed not null. It sets this column to a type of: ObjectID. Then as we all know, OBJECTID fields are now for esri use only and no longer maintained throughout the workflow.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">So what about adding my own ObjectID field like in this post: <a href=\"https:\/\/www.sqlgeometry.com\/?p=31\">Add and object ID to your view<\/a>? Turns out this still doesnt work, as the software still sees the other id field. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This means that Pro is smart enough to look for an identity column but dumb enough to screw it up. <strong>The best thing to do in this case is create another column in the view that is a duplicate of the key with a different name.<\/strong> Then you can join that data on that field and still have a key for your records.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The workflow is simple: Create a view to filter the data in the database Add the view to catalog in ArcGIS Pro Extract the data to a staging table Add the table to the map (note: why cant I work on the data in the catalog without adding to the map?) Perform work &#8211; lots &hellip; <a href=\"https:\/\/www.sqlgeometry.com\/?p=83\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">ArcGISPro choosing an ObjectID from a view. Then losing it.<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-83","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.sqlgeometry.com\/index.php?rest_route=\/wp\/v2\/posts\/83","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlgeometry.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqlgeometry.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlgeometry.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlgeometry.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=83"}],"version-history":[{"count":3,"href":"https:\/\/www.sqlgeometry.com\/index.php?rest_route=\/wp\/v2\/posts\/83\/revisions"}],"predecessor-version":[{"id":86,"href":"https:\/\/www.sqlgeometry.com\/index.php?rest_route=\/wp\/v2\/posts\/83\/revisions\/86"}],"wp:attachment":[{"href":"https:\/\/www.sqlgeometry.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=83"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlgeometry.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=83"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlgeometry.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=83"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}