<?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: What is the proper SQL syntax for including a field alias when creating a view in ArcCatalog? in ArcGIS Enterprise Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-questions/what-is-the-proper-sql-syntax-for-including-a/m-p/538725#M20868</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, you are right.&lt;/P&gt;&lt;P&gt;The correct SQL syntax to use in arcCatalog is to not use spaces.&lt;/P&gt;&lt;P&gt;You might try to replace the spaces with underscores.&lt;/P&gt;&lt;P&gt;For example,&amp;nbsp;&lt;/P&gt;&lt;PRE class="line-numbers language-sql"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;SELECT&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;fc&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;field &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'field_alias'&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;database&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;schema&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;featureclassname_evw &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;fc&lt;/SPAN&gt;‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;To expand on what Manvi said,&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;If you are using a database view, it may not like to participate&amp;nbsp;with geodatabase objects.&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;You might try to register the view with the geodatabase, starting at 10.5, or ArcGIS Pro.&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;A _jive_internal="true" data-containerid="1683" data-containertype="37" data-objectid="56572" data-objecttype="38" href="https://community.esri.com/groups/geodatabase/blog/2016/12/14/new-at-105-registering-a-database-view-with-the-geodatabase" style="color: #287433; background-color: transparent; border: 0px; font-weight: inherit; font-size: inherit; padding: 1px 0px 1px calc(12px + 0.35ex);"&gt;https://community.esri.com/groups/geodatabase/blog/2016/12/14/new-at-105-registering-a-database-view-with-the-geodatabase&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 24 Oct 2018 19:31:27 GMT</pubDate>
    <dc:creator>AndresCastillo</dc:creator>
    <dc:date>2018-10-24T19:31:27Z</dc:date>
    <item>
      <title>What is the proper SQL syntax for including a field alias when creating a view in ArcCatalog?</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/what-is-the-proper-sql-syntax-for-including-a/m-p/538722#M20865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The data is stored in Microsoft SQL Server. &amp;nbsp;The query tested in Microsoft Management Studio is valid, but ArcCatalog and ArcMap are no longer tolerating the spaces and special characters in the aliases. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ArcGIS &amp;amp; ArcCatalog 10.5&lt;/P&gt;&lt;P&gt;Microsoft SQL Server 2017&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do have ArcGIS &amp;amp; ArcCatalog 10.6 on another VM... haven't tried there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also have a support ticket. &amp;nbsp;Thought I'd see if the community had some ideas, too.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2018 19:09:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/what-is-the-proper-sql-syntax-for-including-a/m-p/538722#M20865</guid>
      <dc:creator>IndyHurt1</dc:creator>
      <dc:date>2018-10-23T19:09:09Z</dc:date>
    </item>
    <item>
      <title>Re: What is the proper SQL syntax for including a field alias when creating a view in ArcCatalog?</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/what-is-the-proper-sql-syntax-for-including-a/m-p/538723#M20866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Indy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--Registering &amp;nbsp;the view with the geodatabase would resolve the issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2018 15:08:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/what-is-the-proper-sql-syntax-for-including-a/m-p/538723#M20866</guid>
      <dc:creator>ManviLather1</dc:creator>
      <dc:date>2018-10-24T15:08:31Z</dc:date>
    </item>
    <item>
      <title>Re: What is the proper SQL syntax for including a field alias when creating a view in ArcCatalog?</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/what-is-the-proper-sql-syntax-for-including-a/m-p/538724#M20867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I’ve tried that and it hasn’t worked but I will try again. I noticed something else yesterday, too. When trying to include the alias, ArcCatalog is taking what I think I’ve configured correctly as an alias and using it as the actual field name. As you can imagine, that’s causing problems because what I’m writing as aliases have spaces and special characters.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Alias being used as field name." class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/425249_Alias_being_used_as_field_name.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2018 15:24:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/what-is-the-proper-sql-syntax-for-including-a/m-p/538724#M20867</guid>
      <dc:creator>IndyHurt1</dc:creator>
      <dc:date>2018-10-24T15:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: What is the proper SQL syntax for including a field alias when creating a view in ArcCatalog?</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/what-is-the-proper-sql-syntax-for-including-a/m-p/538725#M20868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, you are right.&lt;/P&gt;&lt;P&gt;The correct SQL syntax to use in arcCatalog is to not use spaces.&lt;/P&gt;&lt;P&gt;You might try to replace the spaces with underscores.&lt;/P&gt;&lt;P&gt;For example,&amp;nbsp;&lt;/P&gt;&lt;PRE class="line-numbers language-sql"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;SELECT&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;fc&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;field &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'field_alias'&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;database&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;schema&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;featureclassname_evw &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;fc&lt;/SPAN&gt;‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;To expand on what Manvi said,&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;If you are using a database view, it may not like to participate&amp;nbsp;with geodatabase objects.&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;You might try to register the view with the geodatabase, starting at 10.5, or ArcGIS Pro.&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;A _jive_internal="true" data-containerid="1683" data-containertype="37" data-objectid="56572" data-objecttype="38" href="https://community.esri.com/groups/geodatabase/blog/2016/12/14/new-at-105-registering-a-database-view-with-the-geodatabase" style="color: #287433; background-color: transparent; border: 0px; font-weight: inherit; font-size: inherit; padding: 1px 0px 1px calc(12px + 0.35ex);"&gt;https://community.esri.com/groups/geodatabase/blog/2016/12/14/new-at-105-registering-a-database-view-with-the-geodatabase&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2018 19:31:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/what-is-the-proper-sql-syntax-for-including-a/m-p/538725#M20868</guid>
      <dc:creator>AndresCastillo</dc:creator>
      <dc:date>2018-10-24T19:31:27Z</dc:date>
    </item>
    <item>
      <title>Re: What is the proper SQL syntax for including a field alias when creating a view in ArcCatalog?</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/what-is-the-proper-sql-syntax-for-including-a/m-p/538726#M20869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks,&amp;nbsp;Andres&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the screen shot above, the SQL was something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select tableName.current_period AS [CURRENT PERIOD],&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Originally, the query didn't even have the "AS" in there and it worked fine, but that no longer works and I haven't been able to determine what has changed. &amp;nbsp;Now, what you see in the square brackets is treated as &lt;STRONG&gt;both&lt;/STRONG&gt; the field name and the alias. &amp;nbsp;Spaces and special characters aren't allowed in field names, but they are acceptable in the alias. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a work around, I've stripped the aliases from the SQL when creating the view in ArcCatalog and I've created a model builder model to use the Alter Field tool to add the aliases after the fact. &amp;nbsp;It's an extra step&amp;nbsp;that allows the original spaces and special characters we've always had in our field aliases, but I'd prefer to return to including the aliases in the view definition. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;New work flow is as follows -&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Create db view in ArcCatalog without alias designations in sql&lt;/LI&gt;&lt;LI&gt;Register view w/ db&lt;/LI&gt;&lt;LI&gt;Add the field aliases via model builder&amp;nbsp;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hoping to eliminate that last step we've recently had to add to the process.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2018 19:56:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/what-is-the-proper-sql-syntax-for-including-a/m-p/538726#M20869</guid>
      <dc:creator>IndyHurt1</dc:creator>
      <dc:date>2018-10-24T19:56:47Z</dc:date>
    </item>
    <item>
      <title>Re: What is the proper SQL syntax for including a field alias when creating a view in ArcCatalog?</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/what-is-the-proper-sql-syntax-for-including-a/m-p/538727#M20870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;Spaces and special characters aren't allowed in field names, but they are acceptable in the alias.&amp;nbsp;&amp;nbsp;&lt;/BLOCKQUOTE&gt;&lt;P&gt;While that may be true in ArcCatalog, I've found it not true when creating a view.&lt;/P&gt;&lt;P&gt;View sql queries do not like the spaces.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Great alterative you provided though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Oct 2018 13:35:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/what-is-the-proper-sql-syntax-for-including-a/m-p/538727#M20870</guid>
      <dc:creator>AndresCastillo</dc:creator>
      <dc:date>2018-10-26T13:35:48Z</dc:date>
    </item>
  </channel>
</rss>

