{"id":1656742,"date":"2022-08-09T07:00:48","date_gmt":"2022-08-09T14:00:48","guid":{"rendered":"https:\/\/www.esri.com\/arcgis-blog\/?post_type=blog&#038;p=1656742"},"modified":"2025-07-22T16:27:27","modified_gmt":"2025-07-22T23:27:27","slug":"utility-network-sql","status":"publish","type":"blog","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/utility-network\/electric-gas\/utility-network-sql","title":{"rendered":"Utility Network Journey: Branch Versioning and SQL"},"author":304562,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"_acf_changed":false,"_searchwp_excluded":""},"categories":[25741,25841,23051],"tags":[565442,766272,766062,216532,763742],"industry":[],"product":[515312],"class_list":["post-1656742","blog","type-blog","status-publish","format-standard","hentry","category-electric-gas","category-telecommunications","category-water","tag-arcgis-utility-network","tag-oracle","tag-postgresql","tag-sql","tag-sql-server","product-utility-network"],"acf":{"authors":[{"ID":304562,"user_firstname":"Robert","user_lastname":"Krisher","nickname":"Robert Krisher","user_nicename":"rkrisher","display_name":"Robert Krisher","user_email":"rkrisher@esri.com","user_url":"","user_registered":"2022-03-17 13:48:14","user_description":"Robert Krisher is a Product Engineer with Esri who has over 15 years of experience implementing Enterprise GIS for Utilities.","user_avatar":"<img data-del=\"avatar\" src='https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/08\/Robert-Krisher-3-213x200.jpg' class='avatar pp-user-avatar avatar-96 photo ' height='96' width='96'\/>"}],"short_description":"This article will show you how you can write sql queries that can read data from the default version in a branch versioned Esri geodatabase.","flexible_content":[{"acf_fc_layout":"content","content":"<h1>Branch Versioning and SQL Queries<\/h1>\n<p><strong>Update<\/strong>: This blog post was originally published on July 8, 2022 but was updated to recommend using materialized views instead of regular database views. All the SQL queries and procedures for the views in the article have been moved to a separate <strong><a href=\"https:\/\/community.esri.com\/t5\/arcgis-utility-network-documents\/branch-version-sql-views-utility-network\/ta-p\/1200811\">community page<\/a><\/strong> to improve the usability and maintainability of the sql statements.<\/p>\n<p>In this article I want to discuss a question I get asked about frequently: How do I write sql queries against branch versioned data like the utility network dataset? The reason this is such a common question is because branch versioned only supports access data via web services and many customers are used to directly accessing their database using sql queries.<\/p>\n<p>The new services-based architecture provides many opportunities to create engaging, meaningful experiences for your end users. The challenge many customers are up against is that they are often support legacy systems that can\u2019t integrate with services or lack the resources internally to replace interfaces and reports that make use of sql.<\/p>\n<p>In this article, we will discuss what branch versioning is, techniques you can use to safely query this data using sql, as well as several examples of how to build reports that make use of these techniques.<\/p>\n"},{"acf_fc_layout":"content","content":"<h1>Branch Versioning<\/h1>\n"},{"acf_fc_layout":"image","image":{"ID":1656962,"id":1656962,"title":"branch_versioning","filename":"branch_versioning.png","filesize":24709,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2022\/07\/branch_versioning.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/utility-network\/electric-gas\/utility-network-sql\/branch_versioning","alt":"Branch Versioning","author":"304562","description":"Branch Versioning","caption":"Branch Versioning","name":"branch_versioning","status":"inherit","uploaded_to":1656742,"date":"2022-07-07 16:19:38","modified":"2022-07-07 16:19:50","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":640,"height":451,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2022\/07\/branch_versioning-213x200.png","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2022\/07\/branch_versioning.png","medium-width":370,"medium-height":261,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2022\/07\/branch_versioning.png","medium_large-width":640,"medium_large-height":451,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2022\/07\/branch_versioning.png","large-width":640,"large-height":451,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2022\/07\/branch_versioning.png","1536x1536-width":640,"1536x1536-height":451,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2022\/07\/branch_versioning.png","2048x2048-width":640,"2048x2048-height":451,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2022\/07\/branch_versioning.png","card_image-width":640,"card_image-height":451,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2022\/07\/branch_versioning.png","wide_image-width":640,"wide_image-height":451}},"image_position":"center","orientation":"horizontal","hyperlink":""},{"acf_fc_layout":"content","content":"<p><a href=\"https:\/\/pro.arcgis.com\/en\/pro-app\/2.8\/help\/data\/geodatabases\/overview\/versioning-types.htm#ESRI_SECTION1_6FA2CFB5F9484FF096740D653C674B5D\">Branch versioning<\/a> is a new type of versioning introduced by Esri to support a services-based architecture for viewing and editing data. If you want to have a better understanding of what branch versioning is and why it\u2019s so important, I encourage you to read the following articles:<\/p>\n<ol>\n<li><a href=\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-enterprise\/data-management\/to-branch-or-not-to-branch\/\">To Branch or not to branch<\/a>is a blog post written by Esri that serves as a good introduction to Branch Versioning for less technical users<\/li>\n<li><a href=\"https:\/\/pro.arcgis.com\/en\/pro-app\/latest\/help\/data\/geodatabases\/overview\/versioning-types.htm\">Versioning types<\/a>in the online help compares the benefits and limitations of branch versioning as well as traditional versioning<\/li>\n<li><a href=\"https:\/\/pro.arcgis.com\/en\/pro-app\/latest\/help\/data\/geodatabases\/overview\/branch-version-scenarios.htm\">Branch versioning scenarios<\/a>from the online help provides a detailed description of the workflows associated with branch versioning<\/li>\n<li><a href=\"https:\/\/www.youtube.com\/watch?v=Ln0shBwhvaU\">Version Management with ArcGIS<\/a>is a recorded technical session from the 2021 Esri User Conference that provides a detailed description of the database and services model for branch versioning<\/li>\n<\/ol>\n<p>The utility network dataset, parcel fabric datasets, and the trace network were built using this new architecture, allowing them to be readily accessible in all desktop, web, and mobile platforms. With the reliance on services for all viewing \/ editing functionality this has left many of our customers wondering how to replace existing interfaces and reports that relied on sql once they migrate to the utility network.<\/p>\n<p>Esri\u2019s recommendation is, and continues to be, that customers use the services and APIs wherever possible However, we also recognize that there are some scenarios, especially those involving other legacy systems, where an API level solution is not possible. With that in mind, let\u2019s look at how we can read data in the default version of the geodatabase.<\/p>\n"},{"acf_fc_layout":"content","content":"<h1>Views<\/h1>\n"},{"acf_fc_layout":"image","image":{"ID":1657022,"id":1657022,"title":"power_bi_model","filename":"power_bi_model.png","filesize":20059,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2022\/07\/power_bi_model.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/utility-network\/electric-gas\/utility-network-sql\/power_bi_model","alt":"Database Views","author":"304562","description":"Database Views","caption":"Database Views","name":"power_bi_model","status":"inherit","uploaded_to":1656742,"date":"2022-07-07 16:57:06","modified":"2022-07-07 16:57:20","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":1043,"height":546,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2022\/07\/power_bi_model-213x200.png","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2022\/07\/power_bi_model.png","medium-width":464,"medium-height":243,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2022\/07\/power_bi_model.png","medium_large-width":768,"medium_large-height":402,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2022\/07\/power_bi_model.png","large-width":1043,"large-height":546,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2022\/07\/power_bi_model.png","1536x1536-width":1043,"1536x1536-height":546,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2022\/07\/power_bi_model.png","2048x2048-width":1043,"2048x2048-height":546,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2022\/07\/power_bi_model-826x432.png","card_image-width":826,"card_image-height":432,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2022\/07\/power_bi_model.png","wide_image-width":1043,"wide_image-height":546}},"image_position":"center","orientation":"horizontal","hyperlink":""},{"acf_fc_layout":"content","content":"<p>Whenever you\u2019re querying transactional data in a database, you always need to make sure that your queries are requesting the data for the time you are interested in. If I\u2019m writing a query to see how much money I have in my bank account I need to make sure that I am not only looking at all of the deposits in my account, but that I am also taking into account all the withdrawals and any committed transactions. Because the transactional models for different systems vary in implementation, many systems provide stored procedures or views that make interacting with these models simpler.<\/p>\n<p>Because of this decision, there are no longer system-maintained views that expose the transactional model for customers. However, it is still possible to query the database directly and get the correct result as long as your queries respect the transactional model. These queries are not a full replacement for multi-version views since they do not support editing and only show data for the current moment in the default. But for customers who are looking to create reports this is exactly what they need!<\/p>\n<p>For example sql statements that show how to create a view that respects this transactional model you can refer to the <strong><a href=\"https:\/\/community.esri.com\/t5\/arcgis-utility-network-documents\/branch-version-sql-views-utility-network\/ta-p\/1200811\">Branch Version Sql Views &#8211; Utility Network<\/a><\/strong> page in the Esri Community page for the ArcGIS Utility Network. This post shows how you can use the queries and logic outlined in the <a href=\"https:\/\/www.youtube.com\/watch?v=Ln0shBwhvaU\">Version Management with ArcGIS<\/a> technical session from the 2021 Esri User Conference to create materialized views for several of the <a href=\"https:\/\/pro.arcgis.com\/en\/pro-app\/latest\/help\/data\/utility-network\/create-a-utility-network.htm\">supported databases<\/a> for the utility network<\/p>\n"},{"acf_fc_layout":"content","content":"<h1>Reports<\/h1>\n"},{"acf_fc_layout":"image","image":{"ID":1657352,"id":1657352,"title":"power_bi_report","filename":"power_bi_report.png","filesize":47910,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2022\/07\/power_bi_report.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/utility-network\/electric-gas\/utility-network-sql\/power_bi_report","alt":"GIS Report","author":"304562","description":"GIS Report","caption":"GIS Report","name":"power_bi_report","status":"inherit","uploaded_to":1656742,"date":"2022-07-07 19:55:41","modified":"2022-07-07 19:55:57","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":1329,"height":747,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2022\/07\/power_bi_report-213x200.png","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2022\/07\/power_bi_report.png","medium-width":464,"medium-height":261,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2022\/07\/power_bi_report.png","medium_large-width":768,"medium_large-height":432,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2022\/07\/power_bi_report.png","large-width":1329,"large-height":747,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2022\/07\/power_bi_report.png","1536x1536-width":1329,"1536x1536-height":747,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2022\/07\/power_bi_report.png","2048x2048-width":1329,"2048x2048-height":747,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2022\/07\/power_bi_report-826x465.png","card_image-width":826,"card_image-height":465,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2022\/07\/power_bi_report.png","wide_image-width":1329,"wide_image-height":747}},"image_position":"center","orientation":"horizontal","hyperlink":""},{"acf_fc_layout":"content","content":"<p>When building reports, you should use materialized views as your building blocks. This means any additional filtering or joining should be done with sql queries that reference these views instead of building separate views for every table in every report. Because materialized views are managed outside of the Esri APIs you may need to recreate some of these views as you make schema changes, so having a separation between your data access layer (views) and your reporting layer (queries) will make managing these changes easier.<\/p>\n<p>If you find that some of your reports need to access data in specific versions, across versions, or need to perform spatial operations then you should strongly consider modifying your approach to make use of one of the APIs provided by Esri. This will ensure that your interface will have effective performance and correctness.<\/p>\n<p>Now that you know how to create views for branch versioned data, let\u2019s look at some examples of how to query these views. You can then refer to them as you build your own reports that reference your own views, fields, and queries.<\/p>\n<p>The examples in the next section show how you can write queries using materialized views for various branch versioned tables. The reports below assume that you have created materialized views for all the branch versioned tables available in a typical Electric Utility Network Foundation deployment.<\/p>\n"},{"acf_fc_layout":"sidebar","content":"<h3>Filtering<\/h3>\n<p>The first basic technique of using these views is to filter your results. This technique is useful for when you are trying to focus your report on a specific type of feature or if you have a very large dataset that you need to break into manageable pieces.<\/p>\n","image_reference":false,"layout":"code_snippet","image_reference_figure":"","snippet":"SELECT\r\n  *\r\nFROM\r\n  Device_BVW\r\nWHERE\r\n  ASSETGROUP = 5;","spotlight_name":"","section_title":"","position":"Center","spotlight_image":false},{"acf_fc_layout":"sidebar","content":"<h3>Joining and Aggregating Data<\/h3>\n<p>Another common requirement for reports from the GIS is to join the information in the GIS with tabular data from other systems. In the example below we have a materialized view of our customers in the GIS and we want to generating a report of the number of customers associated with each device.<\/p>\n","image_reference":false,"layout":"code_snippet","image_reference_figure":"","snippet":"SELECT\r\n  Device.SubnetworkName, Device.AssetID, Count(1)\r\nFROM\r\n  Device_BVW Device, Customer_Info\r\nWHERE\r\n  Device.SPID = Customer_Info.SPID\r\nGROUP BY\r\n  Device.GlobalID\r\nORDER BY\r\n  Count(Customer.SPID) DESC","spotlight_name":"","section_title":"","position":"Center","spotlight_image":false},{"acf_fc_layout":"sidebar","content":"<h3>Associations<\/h3>\n<p>One of the most common requests we have is how to query the associations table to analyze the relationships between equipment and structures. Once you create a materialized view for the associations table the approach is like joining any other relationship table. You can then use this table to analyze the containment, structural attachment, and explicit connectivity between network features. In the query below we are creating a report that lists out the names of each device and the substation it belongs to.<\/p>\n","image_reference":false,"layout":"code_snippet","image_reference_figure":"","snippet":"SELECT\r\n  Station.Name, Device.AssetID\r\nFROM\r\n  StructureBoundary_BVW Station, Device_BVW Device, Associations_BVW Associations\r\nWHERE\r\n  Station.AssetGroup = 1 AND\r\n  Station.GlobalID = Associations.FromGlobalID AND\r\n  Device.GlobalID = Associations.ToGlobalID","spotlight_name":"","section_title":"","position":"Center","spotlight_image":false},{"acf_fc_layout":"sidebar","content":"<h3>Multiple Associations<\/h3>\n<p>Many customer data models need to traverse multiple relationships to produce reports. The most common example of this is to traverse the relationship between structures and assemblies to identify where key pieces of devices are located. In the example below we must traverse the associations table multiple times, first to get all the assemblies attached to structures and then a second time to get all the devices contained in those assemblies. You should exercise some caution with this approach when dealing with large datasets since this may result in hundreds of thousands or millions of combinations. In those cases you should consider breaking up your results using another attribute like asset group, subnetwork, or other characteristic that is important to your organization.<\/p>\n","image_reference":false,"layout":"code_snippet","image_reference_figure":"","snippet":"SELECT\r\n  Structure.AssetID, Assembly.AssetID, Device.AssetID\r\nFROM\r\n  Structure_BVW Structure,\r\n  Assembly_BVW Assembly,\r\n  Device_BVW Device,\r\n  Associations_BVW Attachment,\r\n  Associations_BVW Containment\r\nWHERE\r\n  Structure.GlobalID = Attachment.FromGlobalID AND\r\n  Assembly.GlobalID = Attachment.ToGlobalID AND\r\n  Assembly.GlobalID = Containment.FromGlobalID AND\r\n  Device.GlobalID = Containment.ToGlobalID","spotlight_name":"","section_title":"","position":"Center","spotlight_image":false},{"acf_fc_layout":"content","content":"<h1>Conclusion<\/h1>\n<p>Now that you\u2019ve read this article you are well equipped to create your own materialized views that let you query your branch versioned data for the default version of your database. Use the examples in this article to create your own materialized views that reference your own tables and return the fields you need.<\/p>\n<p>We still recommend customers developing new solutions make use of the APIs, since they provide full access to all the functionality of the GIS. If you need to perform spatial analysis, access non-default data, or edit data you have no other option than using the new APIs. Either way you should now have a better understanding and appreciation of how branch versioning works!<\/p>\n"}],"related_articles":[{"ID":1532622,"post_author":"304562","post_date":"2022-05-09 08:00:33","post_date_gmt":"2022-05-09 15:00:33","post_content":"","post_title":"Journey to the Utility Network: Integrations Overview","post_excerpt":"","post_status":"publish","comment_status":"closed","ping_status":"closed","post_password":"","post_name":"utility-network-integrations-overview","to_ping":"","pinged":"","post_modified":"2025-07-22 16:32:52","post_modified_gmt":"2025-07-22 23:32:52","post_content_filtered":"","post_parent":0,"guid":"https:\/\/www.esri.com\/arcgis-blog\/?post_type=blog&#038;p=1532622","menu_order":0,"post_type":"blog","post_mime_type":"","comment_count":"2","filter":"raw"},{"ID":1540522,"post_author":"304562","post_date":"2022-05-23 07:00:41","post_date_gmt":"2022-05-23 14:00:41","post_content":"","post_title":"Journey to the Utility Network: Common Integrations","post_excerpt":"","post_status":"publish","comment_status":"closed","ping_status":"closed","post_password":"","post_name":"utility-network-integrations-non-network","to_ping":"","pinged":"","post_modified":"2025-12-31 05:42:35","post_modified_gmt":"2025-12-31 13:42:35","post_content_filtered":"","post_parent":0,"guid":"https:\/\/www.esri.com\/arcgis-blog\/?post_type=blog&#038;p=1540522","menu_order":0,"post_type":"blog","post_mime_type":"","comment_count":"0","filter":"raw"},{"ID":2900672,"post_author":"304562","post_date":"2025-05-04 07:48:49","post_date_gmt":"2025-05-04 14:48:49","post_content":"","post_title":"ArcGIS Utility Network migration reading list","post_excerpt":"","post_status":"publish","comment_status":"closed","ping_status":"closed","post_password":"","post_name":"arcgis-utility-network-migration-reading-list","to_ping":"","pinged":"","post_modified":"2026-01-06 08:50:47","post_modified_gmt":"2026-01-06 16:50:47","post_content_filtered":"","post_parent":0,"guid":"https:\/\/www.esri.com\/arcgis-blog\/?post_type=blog&#038;p=2900672","menu_order":0,"post_type":"blog","post_mime_type":"","comment_count":"0","filter":"raw"},{"ID":1527822,"post_author":"304562","post_date":"2022-04-25 08:00:41","post_date_gmt":"2022-04-25 15:00:41","post_content":"","post_title":"Journey to the Utility Network: First Steps","post_excerpt":"","post_status":"publish","comment_status":"closed","ping_status":"closed","post_password":"","post_name":"starting-your-utility-network-journey","to_ping":"","pinged":"","post_modified":"2025-07-22 16:33:20","post_modified_gmt":"2025-07-22 23:33:20","post_content_filtered":"","post_parent":0,"guid":"https:\/\/www.esri.com\/arcgis-blog\/?post_type=blog&#038;p=1527822","menu_order":0,"post_type":"blog","post_mime_type":"","comment_count":"0","filter":"raw"},{"ID":2748552,"post_author":"9432","post_date":"2025-07-21 14:00:15","post_date_gmt":"2025-07-21 21:00:15","post_content":"","post_title":"ArcGIS for Utilities \u2013 Enterprise GIS for Modern Network Information Management","post_excerpt":"","post_status":"publish","comment_status":"closed","ping_status":"closed","post_password":"","post_name":"arcgis-for-utilities-enterprise-gis-for-modern-network-information-management","to_ping":"","pinged":"","post_modified":"2025-09-10 09:33:34","post_modified_gmt":"2025-09-10 16:33:34","post_content_filtered":"","post_parent":0,"guid":"https:\/\/www.esri.com\/arcgis-blog\/?post_type=blog&#038;p=2748552","menu_order":0,"post_type":"blog","post_mime_type":"","comment_count":"0","filter":"raw"}],"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2022\/03\/cardFINAL-1.png","wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2022\/03\/BannerFINAL.png","show_article_image":false},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.9 (Yoast SEO v25.9) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Utility Network Journey: Branch Versioning and SQL<\/title>\n<meta name=\"description\" content=\"This article will show you how you can write sql queries that can read data from the default version in a branch versioned Esri geodatabase.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.esri.com\/arcgis-blog\/products\/utility-network\/electric-gas\/utility-network-sql\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Utility Network Journey: Branch Versioning and SQL\" \/>\n<meta property=\"og:description\" content=\"This article will show you how you can write sql queries that can read data from the default version in a branch versioned Esri geodatabase.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.esri.com\/arcgis-blog\/products\/utility-network\/electric-gas\/utility-network-sql\" \/>\n<meta property=\"og:site_name\" content=\"ArcGIS Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/esrigis\/\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-22T23:27:27+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@ESRI\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":[\"Article\",\"BlogPosting\"],\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/utility-network\/electric-gas\/utility-network-sql#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/utility-network\/electric-gas\/utility-network-sql\"},\"author\":{\"name\":\"Robert Krisher\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/a489c0021b32463617f4a182fee154ae\"},\"headline\":\"Utility Network Journey: Branch Versioning and SQL\",\"datePublished\":\"2022-08-09T14:00:48+00:00\",\"dateModified\":\"2025-07-22T23:27:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/utility-network\/electric-gas\/utility-network-sql\"},\"wordCount\":7,\"publisher\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#organization\"},\"keywords\":[\"ArcGIS Utility Network\",\"Oracle\",\"PostgreSQL\",\"SQL\",\"SQL Server\"],\"articleSection\":[\"Electric &amp; Gas Utilities\",\"Telecommunications\",\"Water\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/utility-network\/electric-gas\/utility-network-sql\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/utility-network\/electric-gas\/utility-network-sql\",\"name\":\"Utility Network Journey: Branch Versioning and SQL\",\"isPartOf\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#website\"},\"datePublished\":\"2022-08-09T14:00:48+00:00\",\"dateModified\":\"2025-07-22T23:27:27+00:00\",\"description\":\"This article will show you how you can write sql queries that can read data from the default version in a branch versioned Esri geodatabase.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/utility-network\/electric-gas\/utility-network-sql#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.esri.com\/arcgis-blog\/products\/utility-network\/electric-gas\/utility-network-sql\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/utility-network\/electric-gas\/utility-network-sql#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.esri.com\/arcgis-blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Utility Network Journey: Branch Versioning and SQL\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#website\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/\",\"name\":\"ArcGIS Blog\",\"description\":\"Get insider info from Esri product teams\",\"publisher\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.esri.com\/arcgis-blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#organization\",\"name\":\"Esri\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png\",\"contentUrl\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png\",\"width\":400,\"height\":400,\"caption\":\"Esri\"},\"image\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/esrigis\/\",\"https:\/\/x.com\/ESRI\",\"https:\/\/www.linkedin.com\/company\/5311\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/a489c0021b32463617f4a182fee154ae\",\"name\":\"Robert Krisher\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/08\/Robert-Krisher-3-213x200.jpg\",\"contentUrl\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/08\/Robert-Krisher-3-213x200.jpg\",\"caption\":\"Robert Krisher\"},\"description\":\"Robert Krisher is a Product Engineer with Esri who has over 15 years of experience implementing Enterprise GIS for Utilities.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/robert-krisher-5a989438\/\"],\"knowsLanguage\":[\"English\"],\"jobTitle\":\"Product Engineer\",\"worksFor\":\"Esri\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/author\/rkrisher\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Utility Network Journey: Branch Versioning and SQL","description":"This article will show you how you can write sql queries that can read data from the default version in a branch versioned Esri geodatabase.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.esri.com\/arcgis-blog\/products\/utility-network\/electric-gas\/utility-network-sql","og_locale":"en_US","og_type":"article","og_title":"Utility Network Journey: Branch Versioning and SQL","og_description":"This article will show you how you can write sql queries that can read data from the default version in a branch versioned Esri geodatabase.","og_url":"https:\/\/www.esri.com\/arcgis-blog\/products\/utility-network\/electric-gas\/utility-network-sql","og_site_name":"ArcGIS Blog","article_publisher":"https:\/\/www.facebook.com\/esrigis\/","article_modified_time":"2025-07-22T23:27:27+00:00","twitter_card":"summary_large_image","twitter_site":"@ESRI","twitter_misc":{"Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["Article","BlogPosting"],"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/utility-network\/electric-gas\/utility-network-sql#article","isPartOf":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/utility-network\/electric-gas\/utility-network-sql"},"author":{"name":"Robert Krisher","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/a489c0021b32463617f4a182fee154ae"},"headline":"Utility Network Journey: Branch Versioning and SQL","datePublished":"2022-08-09T14:00:48+00:00","dateModified":"2025-07-22T23:27:27+00:00","mainEntityOfPage":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/utility-network\/electric-gas\/utility-network-sql"},"wordCount":7,"publisher":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#organization"},"keywords":["ArcGIS Utility Network","Oracle","PostgreSQL","SQL","SQL Server"],"articleSection":["Electric &amp; Gas Utilities","Telecommunications","Water"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/utility-network\/electric-gas\/utility-network-sql","url":"https:\/\/www.esri.com\/arcgis-blog\/products\/utility-network\/electric-gas\/utility-network-sql","name":"Utility Network Journey: Branch Versioning and SQL","isPartOf":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#website"},"datePublished":"2022-08-09T14:00:48+00:00","dateModified":"2025-07-22T23:27:27+00:00","description":"This article will show you how you can write sql queries that can read data from the default version in a branch versioned Esri geodatabase.","breadcrumb":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/utility-network\/electric-gas\/utility-network-sql#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.esri.com\/arcgis-blog\/products\/utility-network\/electric-gas\/utility-network-sql"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/utility-network\/electric-gas\/utility-network-sql#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.esri.com\/arcgis-blog\/"},{"@type":"ListItem","position":2,"name":"Utility Network Journey: Branch Versioning and SQL"}]},{"@type":"WebSite","@id":"https:\/\/www.esri.com\/arcgis-blog\/#website","url":"https:\/\/www.esri.com\/arcgis-blog\/","name":"ArcGIS Blog","description":"Get insider info from Esri product teams","publisher":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.esri.com\/arcgis-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.esri.com\/arcgis-blog\/#organization","name":"Esri","url":"https:\/\/www.esri.com\/arcgis-blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png","contentUrl":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png","width":400,"height":400,"caption":"Esri"},"image":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/esrigis\/","https:\/\/x.com\/ESRI","https:\/\/www.linkedin.com\/company\/5311\/"]},{"@type":"Person","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/a489c0021b32463617f4a182fee154ae","name":"Robert Krisher","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/image\/","url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/08\/Robert-Krisher-3-213x200.jpg","contentUrl":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2025\/08\/Robert-Krisher-3-213x200.jpg","caption":"Robert Krisher"},"description":"Robert Krisher is a Product Engineer with Esri who has over 15 years of experience implementing Enterprise GIS for Utilities.","sameAs":["https:\/\/www.linkedin.com\/in\/robert-krisher-5a989438\/"],"knowsLanguage":["English"],"jobTitle":"Product Engineer","worksFor":"Esri","url":"https:\/\/www.esri.com\/arcgis-blog\/author\/rkrisher"}]}},"text_date":"August 9, 2022","author_name":"Robert Krisher","author_page":"https:\/\/www.esri.com\/arcgis-blog\/author\/rkrisher","custom_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2022\/03\/BannerFINAL.png","primary_product":"ArcGIS Utility Network","tag_data":[{"term_id":565442,"name":"ArcGIS Utility Network","slug":"arcgis-utility-network","term_group":0,"term_taxonomy_id":565442,"taxonomy":"post_tag","description":"","parent":0,"count":87,"filter":"raw"},{"term_id":766272,"name":"Oracle","slug":"oracle","term_group":0,"term_taxonomy_id":766272,"taxonomy":"post_tag","description":"","parent":0,"count":2,"filter":"raw"},{"term_id":766062,"name":"PostgreSQL","slug":"postgresql","term_group":0,"term_taxonomy_id":766062,"taxonomy":"post_tag","description":"","parent":0,"count":3,"filter":"raw"},{"term_id":216532,"name":"SQL","slug":"sql","term_group":0,"term_taxonomy_id":216532,"taxonomy":"post_tag","description":"","parent":0,"count":6,"filter":"raw"},{"term_id":763742,"name":"SQL Server","slug":"sql-server","term_group":0,"term_taxonomy_id":763742,"taxonomy":"post_tag","description":"","parent":0,"count":3,"filter":"raw"}],"category_data":[{"term_id":25741,"name":"Electric &amp; Gas Utilities","slug":"electric-gas","term_group":0,"term_taxonomy_id":25741,"taxonomy":"category","description":"","parent":0,"count":252,"filter":"raw"},{"term_id":25841,"name":"Telecommunications","slug":"telecommunications","term_group":0,"term_taxonomy_id":25841,"taxonomy":"category","description":"","parent":0,"count":112,"filter":"raw"},{"term_id":23051,"name":"Water","slug":"water","term_group":0,"term_taxonomy_id":23051,"taxonomy":"category","description":"","parent":0,"count":462,"filter":"raw"}],"product_data":[{"term_id":515312,"name":"ArcGIS Utility Network","slug":"utility-network","term_group":0,"term_taxonomy_id":515312,"taxonomy":"product","description":"","parent":36981,"count":141,"filter":"raw"}],"primary_product_link":"https:\/\/www.esri.com\/arcgis-blog\/?s=#&products=utility-network","_links":{"self":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/blog\/1656742","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/blog"}],"about":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/types\/blog"}],"author":[{"embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/users\/304562"}],"replies":[{"embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/comments?post=1656742"}],"version-history":[{"count":0,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/blog\/1656742\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/media?parent=1656742"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/categories?post=1656742"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/tags?post=1656742"},{"taxonomy":"industry","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/industry?post=1656742"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/product?post=1656742"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}