<?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: SQL Trigger in Versioned SDE in ArcGIS Enterprise Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-questions/sql-trigger-in-versioned-sde/m-p/458128#M17718</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After an update, the original is not deleted.&amp;nbsp; Here is a screen shot of the A &amp;amp; D table after the same feature has been updated 4 times:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="screen1.png" class="jive-image image-1" src="https://community.esri.com/legacyfs/online/12561_screen1.png" style="width: 620px; height: 514px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I originally was receiving an error, "connection is busy from results for another command", when trying to perform the INSERT and UPDATE on the A table.&amp;nbsp; That is why I suggested to create the UPDATE on the D table.&amp;nbsp; A second test, and this appears to be working with just creating the INSERT, UPDATE trigger on the A table.&amp;nbsp; Not sure why I was receiving this error before.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Sep 2014 13:14:46 GMT</pubDate>
    <dc:creator>JakeSkinner</dc:creator>
    <dc:date>2014-09-16T13:14:46Z</dc:date>
    <item>
      <title>SQL Trigger in Versioned SDE</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/sql-trigger-in-versioned-sde/m-p/458124#M17714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have been researching creating triggers in SQL to update the edit date and acreage values when an edit is completed on an SDE versioned feature class.&amp;nbsp; I have created the triggers and SQL says that the command is completed successfully, but when I make an edit to the feature class, those fields don't get updated.&lt;/P&gt;&lt;P&gt;I am using SQL Server 2008 R2 Management Studio Express and ArcGIS 10.2.1.&amp;nbsp; The feature class is versioned and I am only using the default version.&amp;nbsp; No other versions were created from that.&amp;nbsp; So, I don't need to reconcile any versions back to the default version.&amp;nbsp; The code I am using is below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;Use&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;DNR_SDE&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
GO
&lt;SPAN class="keyword token"&gt;SET&lt;/SPAN&gt; ANSI_NULLS &lt;SPAN class="keyword token"&gt;ON&lt;/SPAN&gt;
GO
&lt;SPAN class="keyword token"&gt;SET&lt;/SPAN&gt; QUOTED_IDENTIFIER &lt;SPAN class="keyword token"&gt;ON&lt;/SPAN&gt;
GO

&lt;SPAN class="keyword token"&gt;CREATE&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;TRIGGER&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;DNR_Edit&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;trg_insert_acres_date_fields&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;ON&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;DNR_Edit&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;TRIBAL_TRUST_LANDS&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;AFTER&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;INSERT&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;UPDATE&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;AS&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;BEGIN&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;SET&lt;/SPAN&gt; NOCOUNT &lt;SPAN class="keyword token"&gt;ON&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;UPDATE&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;DNR_Edit&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;TRIBAL_TRUST_LANDS&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;SET&lt;/SPAN&gt; edit_date &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; getdate&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;WHERE&lt;/SPAN&gt; OBJECTID &lt;SPAN class="operator token"&gt;IN&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;SELECT&lt;/SPAN&gt; OBJECTID &lt;SPAN class="keyword token"&gt;FROM&lt;/SPAN&gt; INSERTED&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;UPDATE&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;DNR_EDIT&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;TRIBAL_TRUST_LANDS&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;SET&lt;/SPAN&gt; Acres &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; shape&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;STArea&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0.000247105&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;WHERE&lt;/SPAN&gt; OBJECTID &lt;SPAN class="operator token"&gt;IN&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;SELECT&lt;/SPAN&gt; OBJECTID &lt;SPAN class="keyword token"&gt;FROM&lt;/SPAN&gt; INSERTED&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;END&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a potential delay with a versioned FC before the fields get populated?&amp;nbsp; I know others have used this same coding for an editable GIS web application and it is immediate, but I cannot figure out why it won't work for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, I would like to have a trigger that would automatically populate the latitude and longitude coordinates for any point added to a feature class or existing point adjusted.&amp;nbsp; Is there any way to do that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for any assistance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lisa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:23:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/sql-trigger-in-versioned-sde/m-p/458124#M17714</guid>
      <dc:creator>LisaDygert</dc:creator>
      <dc:date>2021-12-11T20:23:53Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Trigger in Versioned SDE</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/sql-trigger-in-versioned-sde/m-p/458125#M17715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lisa,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I have not actually worked with adding triggers in SQL Server SDE but I do have some advice about what your issue likely is. The thing to understand about a versioned FeatureClass in SDE is that once a FC is versioned it has three (important) tables that it will use when versioning. There is the Business table likely the one you are editing and the Adds table (a table that holds all the new and edited features that will get moved to the business table once the compress is completed) like the one you need to be editing and the Deletes table that contains a list of feature that are to be deleted when the next compress occurs. So in your workflow you are likely editing the business table and the compress has not occurred yet and when the feature is requested from SDE it is actually getting the Adds table row for that feature and thus you do not see your changes. You can look at the table registry (sde.SDE_Table_Registry) in your geodatbase to determine the name of the adds table for your particular FC (something like DBOwner.a52). The registration_id field will have the number of the a table based on the name of your FC in the table_name column. If you add the trigger to the a table then you will see the edit immediately in ArcGIS and it will be committed to the business table for the FC when the Geodatabase is compressed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Sep 2014 12:32:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/sql-trigger-in-versioned-sde/m-p/458125#M17715</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2014-09-16T12:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Trigger in Versioned SDE</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/sql-trigger-in-versioned-sde/m-p/458126#M17716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Lisa,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When dealing with versioned data, the delta tables (A &amp;amp; D) are updated when a feature is created/deleted/modified.&amp;nbsp; What you will need to do is create two triggers.&amp;nbsp; One on the A table for inserts (creating new features) and another trigger on the D table for updates (moving/modifying features/attributes).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To find the A and D table, you can query the table_registry table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14108711521541370 jive_text_macro" jivemacro_uid="_14108711521541370"&gt;
&lt;P&gt;select registration_id from sde.sde_table_registry where table_name = 'TRIBAL_TRUST_LANDS'&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note:&amp;nbsp; If you are using a DBO schema, change sde.sde_table_registry to dbo.sde_table_registry. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This query will return the registration_id that you can use to query the A &amp;amp; D tables.&amp;nbsp; Ex:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DNR_Edit.a483&lt;/P&gt;&lt;P&gt;DNR_Edit.d483&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can then create the triggers on each of these tables:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14108711186485420" jivemacro_uid="_14108711186485420"&gt;
&lt;P&gt;CREATE TRIGGER [DNR_Edit].[trg_insert_acres_date_fields_insert]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ON [DNR_Edit].[a483]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FOR INSERT&lt;/P&gt;
&lt;P&gt;AS&lt;/P&gt;
&lt;P&gt;BEGIN&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET NOCOUNT ON;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UPDATE [DNR_Edit].[a483]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET edit_date = getdate()&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE OBJECTID IN (SELECT OBJECTID FROM INSERTED)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UPDATE [DNR_Edit].[TRIBAL_TRUST_LANDS]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET edit_date = getdate()&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE OBJECTID IN (SELECT OBJECTID FROM INSERTED)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UPDATE [DNR_Edit].[a483]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET Acres = shape.STArea() * 0.000247105&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE OBJECTID IN (SELECT OBJECTID FROM INSERTED)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UPDATE [DNR_Edit].[TRIBAL_TRUST_LANDS]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET Acres = shape.STArea() * 0.000247105&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE OBJECTID IN (SELECT OBJECTID FROM INSERTED)&lt;/P&gt;
&lt;P&gt;END&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;CREATE TRIGGER [DNR_Edit].[trg_insert_acres_date_fields_update]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ON [DNR_Edit].[d483]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FOR UPDATE&lt;/P&gt;
&lt;P&gt;AS&lt;/P&gt;
&lt;P&gt;BEGIN&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET NOCOUNT ON;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UPDATE [DNR_Edit].[a483]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET edit_date = getdate()&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE OBJECTID IN (SELECT OBJECTID FROM INSERTED)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UPDATE [DNR_Edit].[TRIBAL_TRUST_LANDS]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET edit_date = getdate()&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE OBJECTID IN (SELECT OBJECTID FROM INSERTED)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UPDATE [DNR_Edit].[a483]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET Acres = shape.STArea() * 0.000247105&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE OBJECTID IN (SELECT OBJECTID FROM INSERTED)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UPDATE [DNR_Edit].[TRIBAL_TRUST_LANDS]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET Acres = shape.STArea() * 0.000247105&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE OBJECTID IN (SELECT OBJECTID FROM INSERTED)&lt;/P&gt;
&lt;P&gt;END&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After making your edits, click the Editor dropdown &amp;gt; Save and the feature classes' fields will update.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Sep 2014 12:40:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/sql-trigger-in-versioned-sde/m-p/458126#M17716</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2014-09-16T12:40:03Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Trigger in Versioned SDE</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/sql-trigger-in-versioned-sde/m-p/458127#M17717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jake,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; The D table hold just the deletes for the versioned FC it only has three columns SDE_STATE_ID, SDE_DELETES_ROW_ID, and DELETED_AT columns. When and edit or update occurs the original is marked for deletion and a new row is added to the A Table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Sep 2014 12:48:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/sql-trigger-in-versioned-sde/m-p/458127#M17717</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2014-09-16T12:48:08Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Trigger in Versioned SDE</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/sql-trigger-in-versioned-sde/m-p/458128#M17718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After an update, the original is not deleted.&amp;nbsp; Here is a screen shot of the A &amp;amp; D table after the same feature has been updated 4 times:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="screen1.png" class="jive-image image-1" src="https://community.esri.com/legacyfs/online/12561_screen1.png" style="width: 620px; height: 514px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I originally was receiving an error, "connection is busy from results for another command", when trying to perform the INSERT and UPDATE on the A table.&amp;nbsp; That is why I suggested to create the UPDATE on the D table.&amp;nbsp; A second test, and this appears to be working with just creating the INSERT, UPDATE trigger on the A table.&amp;nbsp; Not sure why I was receiving this error before.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Sep 2014 13:14:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/sql-trigger-in-versioned-sde/m-p/458128#M17718</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2014-09-16T13:14:46Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Trigger in Versioned SDE</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/sql-trigger-in-versioned-sde/m-p/458129#M17719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jake,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Yep that is why I said it is marked for deletion. Anyway I thought that I should clarify your statement.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;D table for updates (moving/modifying features/attributes)&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;But now I think I understand that you were saying that a trigger needs to be added to this table for when the featureclass has a feature modified in some way and then the trigger will update the "a" table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Sep 2014 13:30:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/sql-trigger-in-versioned-sde/m-p/458129#M17719</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2014-09-16T13:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Trigger in Versioned SDE</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/sql-trigger-in-versioned-sde/m-p/458130#M17720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've used the same trigger on th A table only for years.&amp;nbsp; Never worried about the D table.&amp;nbsp; If the record has been deleted, what's left to modify with a trigger?&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/confused.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Sep 2014 14:23:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/sql-trigger-in-versioned-sde/m-p/458130#M17720</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2014-09-16T14:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Trigger in Versioned SDE</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/sql-trigger-in-versioned-sde/m-p/458131#M17721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Based on your statement that you're only using the default version, and, emphasis on, this is my personal opinion, register the FC with "Move Edits to Base", and don't worry about triggers on the A table at all, put the trigger directly on the FC table. During an edit session, you won't see the trigger fire 'till you hit "Save Edits". That's my work flow, at least. Most of my editing is distributed (via AGISSvr Feature Service local copy for editing), and any attributing that is done by triggers is done on the backend like &lt;A _jive_internal="true" href="https://community.esri.com/blogs/HackingArcSDE/2014/12/31/hey-neighbor-whats-your-value"&gt;this&lt;/A&gt;. Why I like this way, is, if I ever have to unregister the FC to not-versioned, when the A table get's deleted, I don't lose a trigger I spend 2 weeks trying to get to work. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Mar 2016 19:13:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/sql-trigger-in-versioned-sde/m-p/458131#M17721</guid>
      <dc:creator>ThomasColson</dc:creator>
      <dc:date>2016-03-25T19:13:30Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Trigger in Versioned SDE</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/sql-trigger-in-versioned-sde/m-p/458132#M17722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Whenever something is updated, SDE inserts into the A table, so that means even if you're just updating an attribute it gets inserted into the A table.&amp;nbsp; So if you trigger is FOR INSERT, it will fire the trigger even when updating.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I only want my trigger to fire when they add a feature.&amp;nbsp; Is there a way to do this?&amp;nbsp; I tried doing a count in the trigger to see if there were other rows in the table with the same OBJECTID and that works great until I try to reconcile and then I get a mutating error.&amp;nbsp; Is there another way?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2018 13:30:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/sql-trigger-in-versioned-sde/m-p/458132#M17722</guid>
      <dc:creator>PriscillaThoopthong1</dc:creator>
      <dc:date>2018-06-28T13:30:20Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Trigger in Versioned SDE</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/sql-trigger-in-versioned-sde/m-p/458133#M17723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;AFTER INSERT, UPDATE&lt;BR /&gt;AS&lt;/P&gt;&lt;P&gt;BEGIN &lt;BR /&gt; SET NOCOUNT ON; &lt;BR /&gt; IF UPDATE ([SHAPE])&lt;BR /&gt;BEGIN&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will only fire your trigger if a new feature is added, or the shape is edited (e.g moved). It will not fire on just an attribute edit.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2018 13:50:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/sql-trigger-in-versioned-sde/m-p/458133#M17723</guid>
      <dc:creator>ThomasColson</dc:creator>
      <dc:date>2018-06-28T13:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Trigger in Versioned SDE</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/sql-trigger-in-versioned-sde/m-p/458134#M17724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks but I don't want it to fire if the shape is moved either.&amp;nbsp; I only want it to fire when the feature is first created.&amp;nbsp; Actually I only want it to fire AFTER they've added a new feature and AFTER they've saved their edits but I think I'm asking too much of ESRI now&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then I have another trigger that I want to fire ONLY the first time a particular attribute is changed and ONLY that particular attribute and ONLY&amp;nbsp;AFTER they've saved their edits.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2018 14:22:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/sql-trigger-in-versioned-sde/m-p/458134#M17724</guid>
      <dc:creator>PriscillaThoopthong1</dc:creator>
      <dc:date>2018-06-28T14:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Trigger in Versioned SDE</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/sql-trigger-in-versioned-sde/m-p/458135#M17725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is all possible with before begin statement, you just need to build the conditions that must be TRUE before BEGIN. I've done something like that before, I just can't seem to find it now....try just after insert, drop the update.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2018 15:24:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/sql-trigger-in-versioned-sde/m-p/458135#M17725</guid>
      <dc:creator>ThomasColson</dc:creator>
      <dc:date>2018-06-28T15:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Trigger in Versioned SDE</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/sql-trigger-in-versioned-sde/m-p/458136#M17726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a similar question but it also veers a little bit away from what has been discussed here so far.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;Using:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;ArcGIS Pro&lt;/LI&gt;&lt;LI&gt;Versioned Database (I am working with and have access to a child checked out from DEFAULT as well as a grandchild (child of child of DEFAULT)&lt;/LI&gt;&lt;LI&gt;Oracle w/ SDE&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My purpose is to design a trigger so that the creation of a new feature in a specified feature class is recorded and stored in a history_tracking_table. A unique ID, the user who made the change, and the change date are captured as well. I have done this and it's functional. See code below:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;create&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;or&lt;/SPAN&gt; replace
&lt;SPAN class="keyword token"&gt;trigger&lt;/SPAN&gt; insert_obs_history_2
&lt;SPAN class="keyword token"&gt;AFTER&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;INSERT&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="keyword token"&gt;ON&lt;/SPAN&gt; A261570
&amp;nbsp; &lt;SPAN class="keyword token"&gt;FOR EACH ROW&lt;/SPAN&gt;
&amp;nbsp; 
&lt;SPAN class="keyword token"&gt;DECLARE&lt;/SPAN&gt;
username &lt;SPAN class="keyword token"&gt;varchar&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;20&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
prev_Match_Recs number&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;BEGIN&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="keyword token"&gt;SELECT&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;COUNT&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;INTO&lt;/SPAN&gt; prev_Match_Recs
&amp;nbsp; &lt;SPAN class="keyword token"&gt;FROM&lt;/SPAN&gt; HISTORY_TRACKING_STATE
&amp;nbsp; &lt;SPAN class="keyword token"&gt;WHERE&lt;/SPAN&gt; HISTORY_ACTION &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'INSERTED'&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;AND&lt;/SPAN&gt;
&amp;nbsp; HISTORY_REPORTID &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; :new&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;O_REPORTID&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;IF&lt;/SPAN&gt; prev_Match_Recs &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;AND&lt;/SPAN&gt;
:new&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;O_REPORTID &lt;SPAN class="operator token"&gt;IS&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;NOT&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;NULL&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;AND&lt;/SPAN&gt;
:new&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SUBMISSION_STATE_ID &lt;SPAN class="operator token"&gt;IS&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;NULL&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;AND&lt;/SPAN&gt;
:old&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SUBMISSION_STATE_ID &lt;SPAN class="operator token"&gt;IS&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;NULL&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="keyword token"&gt;THEN&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;SELECT&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;USER&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;INTO&lt;/SPAN&gt; username &lt;SPAN class="keyword token"&gt;FROM&lt;/SPAN&gt; dual&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;INSERT&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;INTO&lt;/SPAN&gt; HISTORY_TRACKING_STATE &lt;SPAN class="keyword token"&gt;VALUES&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; :new&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;O_REPORTID&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; :new&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SUBMISSION_STATE_ID&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; username&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; SYSTIMESTAMP&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'INSERTED'&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="keyword token"&gt;END&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;IF&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;END&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;My question is&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt; How do I create an 'update' trigger to capture when the 'SUBMISSION_STATE_ID' field changes if my data is versioned? &lt;/STRONG&gt;I am not able to run an UPDATE trigger and grab ':new' and ':old' values because with versioning the change in the field value is just an addition to the A#### table. I would like to be able to compare the old and new value of this field when it is changed to make sure they are not the same.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:23:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/sql-trigger-in-versioned-sde/m-p/458136#M17726</guid>
      <dc:creator>MikeLachance1</dc:creator>
      <dc:date>2021-12-11T20:23:55Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Trigger in Versioned SDE</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/sql-trigger-in-versioned-sde/m-p/458137#M17727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Beautiful solution for those with workflows that allow&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;registering the FC as versioned with the option "Move Edits to Base"&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Oct 2020 18:14:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/sql-trigger-in-versioned-sde/m-p/458137#M17727</guid>
      <dc:creator>AndresCastillo</dc:creator>
      <dc:date>2020-10-10T18:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Trigger in Versioned SDE</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/sql-trigger-in-versioned-sde/m-p/458138#M17728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There's this GIS Stackexchange thread talking about how instead of implementing a trigger on the A&amp;amp;D tables, do it on the versioned view (ie. &amp;lt;TABLE_NAME_EVW&amp;gt;):&lt;/P&gt;&lt;P&gt;&lt;A href="https://gis.stackexchange.com/questions/177893/arcsde-10-1-insert-update-trigger-on-adds-a-table-oracle-11g-and-feature-ser" title="https://gis.stackexchange.com/questions/177893/arcsde-10-1-insert-update-trigger-on-adds-a-table-oracle-11g-and-feature-ser"&gt;editing - ArcSDE 10.1 Insert/Update Trigger on Adds (A) Table (Oracle 11g) and Feature Services on ArcGIS Server - Geogr…&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have yet to try this, but I will verify it because I'm surprised they were able to write to a view (I thought it was read-only, per Oracle):&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_7004.htm" title="https://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_7004.htm"&gt;CREATE TRIGGER&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #222222; background-color: #ffffff; font-size: 14px; margin: 0px 0px 1.25rem;"&gt;&lt;SPAN class="" style="font-weight: bold; padding-top: 10px;"&gt;INSTEAD OF Triggers&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;UL style="background-color: #ffffff; font-size: 14px; margin: 0px 0px 1.25rem 35px; padding: 0px 0px 0px 10px;"&gt;&lt;LI style="margin: 10px 0px 20px;"&gt;&lt;P style="font-weight: 300; font-size: 14px; margin: 0px 0px 1.25rem;"&gt;&lt;CODE style="color: #000000; background-color: #eeeeee; font-weight: normal; padding: 3px 0px;"&gt;INSTEAD&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE style="color: #000000; background-color: #eeeeee; font-weight: normal; padding: 3px 0px;"&gt;OF&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;triggers are valid only for views. You cannot specify an&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE style="color: #000000; background-color: #eeeeee; font-weight: normal; padding: 3px 0px;"&gt;INSTEAD&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE style="color: #000000; background-color: #eeeeee; font-weight: normal; padding: 3px 0px;"&gt;OF&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;trigger on a table.&lt;/P&gt;&lt;/LI&gt;&lt;LI style="margin: 10px 0px 20px;"&gt;&lt;P style="font-weight: 300; font-size: 14px; margin: 0px 0px 1.25rem;"&gt;You can read both the :&lt;CODE style="color: #000000; background-color: #eeeeee; font-weight: normal; padding: 3px 0px;"&gt;OLD&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and the :&lt;CODE style="color: #000000; background-color: #eeeeee; font-weight: normal; padding: 3px 0px;"&gt;NEW&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;value, but you cannot write either the :&lt;CODE style="color: #000000; background-color: #eeeeee; font-weight: normal; padding: 3px 0px;"&gt;OLD&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;or the :&lt;CODE style="color: #000000; background-color: #eeeeee; font-weight: normal; padding: 3px 0px;"&gt;NEW&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;value.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In that article, they have lots of good points, including:&lt;/P&gt;&lt;P&gt;Invoking the trigger&amp;nbsp;via the Feature Service query endpoint (&lt;A href="https://&amp;lt;machine.domain.com&amp;gt;/webadaptor/rest/services/&amp;lt;folder&amp;gt;/&amp;lt;serviceName&amp;gt;/FeatureServer/0/query"&gt;https://&amp;lt;machine.domain.com&amp;gt;/webadaptor/rest/services/&amp;lt;folder&amp;gt;/&amp;lt;serviceName&amp;gt;/FeatureServer/0/query&lt;/A&gt;) via a web edit post API call.&lt;/P&gt;&lt;P&gt;They mention that if the Geodatabase Version Name parameter is not specified, edits are made to published map's version.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;They also mention a cool way to use python to generate unique GUID's similar to Global IDs:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://support.esri.com/en/technical-article/000011677" title="https://support.esri.com/en/technical-article/000011677"&gt;How To: Calculate unique identifier values similar to Global IDs&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe I ran into your same question on GIS StackEchange as well:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://gis.stackexchange.com/questions/304573/how-to-create-update-triggers-to-track-field-values-changes-when-data-is-versi" title="https://gis.stackexchange.com/questions/304573/how-to-create-update-triggers-to-track-field-values-changes-when-data-is-versi"&gt;enterprise geodatabase - How to Create 'Update Triggers' to Track Field Values Changes When Data is Versioned? - Geograp…&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did find an Esri documentation saying its ok to grant privileges to a user both on the base table and directly on the versioned view of the table&amp;nbsp;&lt;SPAN&gt;(ie. &amp;lt;TABLE_NAME_EVW&amp;gt;), but that is indeed different than writing to the view:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A class="link-titled" href="https://desktop.arcgis.com/en/arcmap/10.3/manage-data/gdbs-in-oracle/privileges-oracle.htm" title="https://desktop.arcgis.com/en/arcmap/10.3/manage-data/gdbs-in-oracle/privileges-oracle.htm"&gt;Privileges for geodatabases in Oracle—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #4d4d4d;"&gt;If the user will be editing versioned data through a versioned view, the user must also be granted SELECT, INSERT, UPDATE, and DELETE privileges on the versioned view. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN style="color: #4d4d4d; background-color: #ffffff;"&gt;When you use the&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d; background-color: #ffffff; font-weight: bold;"&gt;Privileges&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;dialog box in ArcGIS to grant the SELECT, INSERT, UPDATE, and DELETE privileges on a versioned feature class, those privileges are automatically granted on the associated versioned view.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #4d4d4d; "&gt;Another Esri documentation explains editing versioned views, which I believe applies to update triggers which edit record columns as well:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #4d4d4d; "&gt;&lt;A class="link-titled" href="https://desktop.arcgis.com/en/arcmap/10.3/manage-data/using-sql-with-gdbs/overview-edit-versioned-data-with-sql.htm" title="https://desktop.arcgis.com/en/arcmap/10.3/manage-data/using-sql-with-gdbs/overview-edit-versioned-data-with-sql.htm"&gt;An overview of editing versioned data using SQL—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #4d4d4d; "&gt;&lt;A class="link-titled" href="https://desktop.arcgis.com/en/arcmap/10.3/manage-data/using-sql-with-gdbs/edit-versioned-data-using-sql-oracle.htm" title="https://desktop.arcgis.com/en/arcmap/10.3/manage-data/using-sql-with-gdbs/edit-versioned-data-using-sql-oracle.htm"&gt;Edit versioned data in Oracle using SQL—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #fefefe; color: #4d4d4d; "&gt;To edit versioned data from a SQL client, you must edit a versioned view of the data, not the base (business) table itself.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #fefefe; color: #4d4d4d; "&gt;Editing the base table directly could lead to orphaned records and data loss.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Oct 2020 20:16:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/sql-trigger-in-versioned-sde/m-p/458138#M17728</guid>
      <dc:creator>AndresCastillo</dc:creator>
      <dc:date>2020-10-10T20:16:01Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Trigger in Versioned SDE</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/sql-trigger-in-versioned-sde/m-p/1516074#M40185</link>
      <description>&lt;P&gt;Can we update directly an attribute on A table or Versioned View on A table trigger for insert? I could see globalids 000000-00000-00000-000000 in A Table and base table after editing any feature in arcgis pro.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What needs to be done to avoid 0's in Global Id field?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 13:38:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/sql-trigger-in-versioned-sde/m-p/1516074#M40185</guid>
      <dc:creator>vijaybadugu</dc:creator>
      <dc:date>2024-08-07T13:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Trigger in Versioned SDE</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/sql-trigger-in-versioned-sde/m-p/1605927#M42026</link>
      <description>&lt;P&gt;What if the table is not versioned ? I tried to record changes to a non-versioned table by copying some attributes (non spatial, just ordinary attribute data) to another table using triger (after update) whenever there is update. The trigger works fine on non-spatial table.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Apr 2025 08:51:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/sql-trigger-in-versioned-sde/m-p/1605927#M42026</guid>
      <dc:creator>yockee</dc:creator>
      <dc:date>2025-04-15T08:51:06Z</dc:date>
    </item>
  </channel>
</rss>

