<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Spatial views from SQL Server 2012 in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/spatial-views-from-sql-server-2012/m-p/689852#M39121</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: vangelo&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I should point out that this is a very expensive use of views -- If the content of the&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;base table isn't changing frequently, but frequent queries are made, then you'd be&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;better off running a script to make a bunch of singleton tables, doing the UNION&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;processing &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;once&lt;/SPAN&gt;&lt;SPAN&gt;, rather than incurring that cost with each query.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- V&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Jun 2013 18:16:15 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2013-06-27T18:16:15Z</dc:date>
    <item>
      <title>Spatial views from SQL Server 2012</title>
      <link>https://community.esri.com/t5/data-management-questions/spatial-views-from-sql-server-2012/m-p/689846#M39115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: mbakerDPS&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;All,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have created a SQL spatial statement to test out how a) the union function works, and b) how creating a view of this data will work with ArcGIS.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;a) the function i'm testing is: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;SELECT GEOMETRY::UnionAggregate(shape)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;FROM CENSUS_TRACTS_2010_2877&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;WHERE PCT_ASIAN &amp;gt; 5&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;which gives the following result:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]25497[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;b) our database will require using a view of spatial data (using a union, etc.) to serve boundaries to our internal users. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To accomplish this, it seems that a spatial view would be the best use case, as that gives us the option to edit/maintain one file, and the view will serve up a fresh version of the boundaries.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Problem is, when I create the view in SQL Server, it will not show up in ArcMap, and I get the error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Warning: Could not add the specified data object to the map.&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think I might be creating the view incorrectly, as this is the field properties ArcMap sees from the view:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]25498[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;...which doesn't seem correct.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anyone point me to a place that describes how to create / register / use a spatial view in ArcMap / SQL Server 2012?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-mb&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Jun 2013 14:17:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/spatial-views-from-sql-server-2012/m-p/689846#M39115</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2013-06-26T14:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial views from SQL Server 2012</title>
      <link>https://community.esri.com/t5/data-management-questions/spatial-views-from-sql-server-2012/m-p/689847#M39116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Matthew,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;the problem is that your view does not have something ArcMap recognizes as an ObjectID field. ArcMap must have a field that it can use as a unique identifier. It is a little tricky to generate a field using something like a RowID in SQL Server when you are aggregating a single column, but you can do something inelegant like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;SELECT &lt;/SPAN&gt;&lt;STRONG&gt;1 as ObjectID, &lt;/STRONG&gt;&lt;SPAN&gt;GEOMETRY::UnionAggregate(shape)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;FROM CENSUS_TRACTS_2010_2877&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;WHERE PCT_ASIAN &amp;gt; 5&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This will obviously only work in this case when your view is resulting in a single record. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Shannon&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jun 2013 01:24:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/spatial-views-from-sql-server-2012/m-p/689847#M39116</guid>
      <dc:creator>ShannonShields</dc:creator>
      <dc:date>2013-06-27T01:24:47Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial views from SQL Server 2012</title>
      <link>https://community.esri.com/t5/data-management-questions/spatial-views-from-sql-server-2012/m-p/689848#M39117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: mbakerDPS&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your help, Shannon...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's the result I get back:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]25554[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;...definitely looks strange...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think I might have to try a more realistic example to see what I get back.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also: someone mentioned a tool called 'create spatial view', but I don't see that anywhere in my 10.1 toolbox...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-m&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jun 2013 16:09:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/spatial-views-from-sql-server-2012/m-p/689848#M39117</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2013-06-27T16:09:07Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial views from SQL Server 2012</title>
      <link>https://community.esri.com/t5/data-management-questions/spatial-views-from-sql-server-2012/m-p/689849#M39118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Many thanks, Shannon! That worked great!!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Next I will try a more realistic example using our school boundaries...I will be in touch!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you again!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-m&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jun 2013 16:16:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/spatial-views-from-sql-server-2012/m-p/689849#M39118</guid>
      <dc:creator>MatthewBaker2</dc:creator>
      <dc:date>2013-06-27T16:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial views from SQL Server 2012</title>
      <link>https://community.esri.com/t5/data-management-questions/spatial-views-from-sql-server-2012/m-p/689850#M39119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: vangelo&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That output looked right to me (binary stream, converted to ASCII). What result were&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; you&amp;nbsp; expecting?&amp;nbsp;&amp;nbsp; If you want Well-Known Text back, you need to include it in the query.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You need to decide how you want to use ArcGIS.&amp;nbsp; If you just want to use Query Layers&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;with existing SQL geometry tables or views, then you don't need to learn geodatabase&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; tools.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- V&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jun 2013 16:22:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/spatial-views-from-sql-server-2012/m-p/689850#M39119</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2013-06-27T16:22:37Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial views from SQL Server 2012</title>
      <link>https://community.esri.com/t5/data-management-questions/spatial-views-from-sql-server-2012/m-p/689851#M39120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sorry Vince, it looked wrong because I had a setting wrong in SQL management studio. Shannon's solution worked fine! Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;That output looked right to me (binary stream, converted to ASCII). What result were&lt;BR /&gt; you&amp;nbsp; expecting?&amp;nbsp;&amp;nbsp; If you want Well-Known Text back, you need to include it in the query.&lt;BR /&gt;&lt;BR /&gt;You need to decide how you want to use ArcGIS.&amp;nbsp; If you just want to use Query Layers&lt;BR /&gt;with existing SQL geometry tables or views, then you don't need to learn geodatabase&lt;BR /&gt; tools.&lt;BR /&gt;&lt;BR /&gt;- V&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jun 2013 16:28:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/spatial-views-from-sql-server-2012/m-p/689851#M39120</guid>
      <dc:creator>MatthewBaker2</dc:creator>
      <dc:date>2013-06-27T16:28:02Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial views from SQL Server 2012</title>
      <link>https://community.esri.com/t5/data-management-questions/spatial-views-from-sql-server-2012/m-p/689852#M39121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: vangelo&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I should point out that this is a very expensive use of views -- If the content of the&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;base table isn't changing frequently, but frequent queries are made, then you'd be&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;better off running a script to make a bunch of singleton tables, doing the UNION&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;processing &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;once&lt;/SPAN&gt;&lt;SPAN&gt;, rather than incurring that cost with each query.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- V&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jun 2013 18:16:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/spatial-views-from-sql-server-2012/m-p/689852#M39121</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2013-06-27T18:16:15Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial views from SQL Server 2012</title>
      <link>https://community.esri.com/t5/data-management-questions/spatial-views-from-sql-server-2012/m-p/689853#M39122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes it is...I'm figuring out how spatial views work in the hopes that we can utilize them "properly"...but with that said, it will all be dependent on the amount the inputs are updated, as you've suggested. Thanks again!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jun 2013 18:18:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/spatial-views-from-sql-server-2012/m-p/689853#M39122</guid>
      <dc:creator>MatthewBaker2</dc:creator>
      <dc:date>2013-06-27T18:18:56Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial views from SQL Server 2012</title>
      <link>https://community.esri.com/t5/data-management-questions/spatial-views-from-sql-server-2012/m-p/689854#M39123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Shannon and Vince,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried out this function with great success:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;SELECT AVG(OBJECTID) AS ID, ELM_SCHOOL, GEOMETRY::UnionAggregate(Shape) AS geom&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;FROM [gissql12].[gdb].[bounds_2012]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;where ELEM_NUM &amp;gt; 0 &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;GROUP BY [elm_SCHOOL]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This groups all elementary school boundary 'chunks' into one geometry by merging features together by their name (this is how it would be done)...boundaries with an ELEM_NUM &amp;gt; 0 are those within our district.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;...but you'll notice my OBJECTID hack!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any thoughts on how to merge geometries together and generate a useful (to ArcMap) OBJECTID? I suppose averaging the object (or some similar function) would be acceptable?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-m&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jun 2013 20:37:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/spatial-views-from-sql-server-2012/m-p/689854#M39123</guid>
      <dc:creator>MatthewBaker2</dc:creator>
      <dc:date>2013-06-27T20:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial views from SQL Server 2012</title>
      <link>https://community.esri.com/t5/data-management-questions/spatial-views-from-sql-server-2012/m-p/689855#M39124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: vangelo&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Registered rowid (objectid) columns have a very specific purpose -- they tie the graphics&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;on the map to the rows in the table.&amp;nbsp; Not only must the values be NOT NULL and unique,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;they also must be reproducible in successive queries.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;An avg() function could not be guaranteed to return unique values, and even a min()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;would not be reversible without a full table scan.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You could use views to simplify the creation of "materialized views", but those materialized&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;views would be real tables with fixed values and storage requiements.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- V&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jun 2013 20:47:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/spatial-views-from-sql-server-2012/m-p/689855#M39124</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2013-06-27T20:47:04Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial views from SQL Server 2012</title>
      <link>https://community.esri.com/t5/data-management-questions/spatial-views-from-sql-server-2012/m-p/689856#M39125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;So what I'm gathering is that spatial views are *not* the way to provide dynamic views of aggregated data that is otherwise being maintained as seperate features...?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jun 2013 20:51:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/spatial-views-from-sql-server-2012/m-p/689856#M39125</guid>
      <dc:creator>MatthewBaker2</dc:creator>
      <dc:date>2013-06-27T20:51:28Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial views from SQL Server 2012</title>
      <link>https://community.esri.com/t5/data-management-questions/spatial-views-from-sql-server-2012/m-p/689857#M39126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: KAdamsHRSA&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi Shannon and Vince,&lt;BR /&gt;&lt;BR /&gt;I tried out this function with great success:&lt;BR /&gt;&lt;BR /&gt;SELECT AVG(OBJECTID) AS ID, ELM_SCHOOL, GEOMETRY::UnionAggregate(Shape) AS geom&lt;BR /&gt;FROM [gissql12].[gdb].[bounds_2012]&lt;BR /&gt;where ELEM_NUM &amp;gt; 0 &lt;BR /&gt;GROUP BY [elm_SCHOOL]&lt;BR /&gt;&lt;BR /&gt;This groups all elementary school boundary 'chunks' into one geometry by merging features together by their name (this is how it would be done)...boundaries with an ELEM_NUM &amp;gt; 0 are those within our district.&lt;BR /&gt;&lt;BR /&gt;...but you'll notice my OBJECTID hack!&lt;BR /&gt;&lt;BR /&gt;Any thoughts on how to merge geometries together and generate a useful (to ArcMap) OBJECTID? I suppose averaging the object (or some similar function) would be acceptable?&lt;BR /&gt;&lt;BR /&gt;-m&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Could you do the "heavy lifting" in a preliminary query, then enclose the results in an outer query that uses the SQL Server ROW_NUMBER() function to generate your final object IDs?&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;SELECT ROW_NUMBER() OVER (order by elm_school) as OBJECTID, theData.* &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;FROM (&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]SELECT ELM_SCHOOL, GEOMETRY::UnionAggregate(Shape) AS geom&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;FROM [gissql12].[gdb].[bounds_2012]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;where ELEM_NUM &amp;gt; 0 &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;GROUP BY [elm_SCHOOL]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/INDENT]) theData&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jul 2013 18:34:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/spatial-views-from-sql-server-2012/m-p/689857#M39126</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2013-07-15T18:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial views from SQL Server 2012</title>
      <link>https://community.esri.com/t5/data-management-questions/spatial-views-from-sql-server-2012/m-p/689858#M39127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;KAdamsHRSA / Keith! That worked like a charm!!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This will solve many similar issues for us...many many thank you's for this solution!!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To create the view, be sure to use the SQL:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;create view SchoolBoundaries_Elem as&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SELECT ROW_NUMBER() OVER (order by elm_school) as OBJECTID, theData.*&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;FROM (&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SELECT ELM_SCHOOL, GEOMETRY::UnionAggregate(Shape) AS geom&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;FROM devdbname.planning.SCHOOLBOUNDARIES_ALL&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;where ELEM_NUM &amp;gt; 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;GROUP BY [elm_SCHOOL]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;) theData &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-m&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Aug 2013 16:02:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/spatial-views-from-sql-server-2012/m-p/689858#M39127</guid>
      <dc:creator>MatthewBaker2</dc:creator>
      <dc:date>2013-08-02T16:02:02Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial views from SQL Server 2012</title>
      <link>https://community.esri.com/t5/data-management-questions/spatial-views-from-sql-server-2012/m-p/689859#M39128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: mbakerDPS&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Keith et al, I spoke too soon...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I get an error when trying to create a view from this query:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"SQL text cannot be represented in the grid pane and diagram pane."&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;any thoughts on that one?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-m&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Aug 2013 16:24:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/spatial-views-from-sql-server-2012/m-p/689859#M39128</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2013-08-02T16:24:56Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial views from SQL Server 2012</title>
      <link>https://community.esri.com/t5/data-management-questions/spatial-views-from-sql-server-2012/m-p/689860#M39129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here's an issue: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The OBJECTID field created in that view is of DOUBLE type - which isn't recognized by ArcGIS as a valid OBJECTID field (needs to be of Object ID data type).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a way to create this view such that the OBJECTID field is of Object ID data type?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-m&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Aug 2013 16:36:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/spatial-views-from-sql-server-2012/m-p/689860#M39129</guid>
      <dc:creator>MatthewBaker2</dc:creator>
      <dc:date>2013-08-02T16:36:54Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial views from SQL Server 2012</title>
      <link>https://community.esri.com/t5/data-management-questions/spatial-views-from-sql-server-2012/m-p/689861#M39130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: vangelo&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In order to qualify as a registered rowid column, it must be an integer (4-byte) and NOT NULL and contain unique values which are repeated in successive queries. -V&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Aug 2013 01:04:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/spatial-views-from-sql-server-2012/m-p/689861#M39130</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2013-08-03T01:04:57Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial views from SQL Server 2012</title>
      <link>https://community.esri.com/t5/data-management-questions/spatial-views-from-sql-server-2012/m-p/689862#M39131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Vince et al,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you think of a way to convert the dynamically generated OBJECTID in the above solution to INT?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've tried a few methods to CONVERT to INT, but ArcGIS reads a SQL Server INT-type column as LONG INTEGER...thus not reading as an OBJECTID field...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thank you again!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-m&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Aug 2013 17:52:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/spatial-views-from-sql-server-2012/m-p/689862#M39131</guid>
      <dc:creator>MatthewBaker2</dc:creator>
      <dc:date>2013-08-05T17:52:48Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial views from SQL Server 2012</title>
      <link>https://community.esri.com/t5/data-management-questions/spatial-views-from-sql-server-2012/m-p/689863#M39132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: mbakerDPS&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm going to run this SQL after I create a table - and am looking to move to FME Workbench where I can build this into a procedure:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ALTER TABLE tableName ADD OID int IDENTITY(1,1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;alter table tableName &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;add constraint PK_primaryKeyName primary key(OID)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This will create an OID column that ArcGIS recognizes...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Will have to do more testing, but seems this might work for now...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Aug 2013 15:48:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/spatial-views-from-sql-server-2012/m-p/689863#M39132</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2013-08-16T15:48:50Z</dc:date>
    </item>
  </channel>
</rss>

