<?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: Using sde.next_rowid in T-SQL in Geodatabase Questions</title>
    <link>https://community.esri.com/t5/geodatabase-questions/using-sde-next-rowid-in-t-sql/m-p/761998#M537</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mark. &amp;nbsp;I'm curious to see how this works in the long term. &amp;nbsp;I'm coming from Oracle, where updating the objectid is easier because the next_rowid is a function. &amp;nbsp;We've been using SDE there for a very long time, and from experience, my biggest rule is to never mess with SDE from SQL, always use SDE to do the work. &amp;nbsp;There are so many inter-dependencies in the GDB and metadata tables that you may think you're okay, and then all of a sudden realize an issue is cropping up. &amp;nbsp;I used to try and go around SDE for performance and ease of use, but vowed to abandon that idea after we had to recover the database back to a point-in-time before I touched it. &amp;nbsp;I don't have enough experience with SDE and MS SQL yet to comment, but I'm interested in what others have to say.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sherrie&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 15 Sep 2017 14:41:56 GMT</pubDate>
    <dc:creator>SherrieKubis</dc:creator>
    <dc:date>2017-09-15T14:41:56Z</dc:date>
    <item>
      <title>Using sde.next_rowid in T-SQL</title>
      <link>https://community.esri.com/t5/geodatabase-questions/using-sde-next-rowid-in-t-sql/m-p/761989#M528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; border: 0px; font-size: 14px;"&gt;SQL Server 2016&amp;nbsp;&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff; border: 0px; font-size: 14px;"&gt;ArcGIS 10.5&amp;nbsp;&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff; border: 0px; font-size: 14px;"&gt;I want to insert into a registered table using set processing using sde.next_rowid. &amp;nbsp;&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff; border: 0px; font-size: 14px;"&gt;I do this in Oracle as:&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff; border: 0px; font-size: 14px;"&gt;INSERT INTO MYTABLE (OBJECTID, SITE_ID)&amp;nbsp;&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff; border: 0px; font-size: 14px;"&gt;SELECT SDE.GDB_UTIL.NEXT(ROWID ('OWNER','MYTABLE'), SITE_ID FROM MYVIEW;&amp;nbsp;&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff; border: 0px; font-size: 14px;"&gt;In SQL Server ESRI documentation examples I see selecting the objectid, writing down the number, and then hard coding it into the insert statement. &amp;nbsp;&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff; border: 0px; font-size: 14px;"&gt;This will be a nightly job that will insert thousands of rows, so set processing is required.&amp;nbsp;&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff; border: 0px; font-size: 14px;"&gt;I try&amp;nbsp;&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff; border: 0px; font-size: 14px;"&gt;INSERT INTO MYTABLE&amp;nbsp;&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff; border: 0px; font-size: 14px;"&gt;SELECT SDE.NEXT_ROWID ('OWNER','MYTABLE'), SITE_ID&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff; border: 0px; font-size: 14px;"&gt;FROM OWNER.MYVIEW;&amp;nbsp;&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff; border: 0px; font-size: 14px;"&gt;and get &amp;nbsp;&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff; border: 0px; font-size: 14px;"&gt;Cannot find either column "SDE" or the user-defined function or aggregate "SDE.NEXT_ROWID", or the name is ambiguous.&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff; border: 0px; font-size: 14px;"&gt;I can use SDE.NEXT_ROWID to query like so:&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff; border: 0px; font-size: 14px;"&gt;DECLARE @id as integer&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff; border: 0px; font-size: 14px;"&gt;EXEC sde.next_rowid 'OWNER', 'MYTABLE', @id OUTPUT;&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff; border: 0px; font-size: 14px;"&gt;SELECT @id "Next ObjectID";&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff; border: 0px; font-size: 14px;"&gt;and this works just fine. &amp;nbsp;&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff; border: 0px; font-size: 14px;"&gt;I'm new to SQL Server, I'm sure it's a syntax issue.&amp;nbsp;&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff; border: 0px; font-size: 14px;"&gt;Any insights are appreciated.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 May 2017 17:37:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/using-sde-next-rowid-in-t-sql/m-p/761989#M528</guid>
      <dc:creator>SherrieKubis</dc:creator>
      <dc:date>2017-05-30T17:37:12Z</dc:date>
    </item>
    <item>
      <title>Re: Using sde.next_rowid in T-SQL</title>
      <link>https://community.esri.com/t5/geodatabase-questions/using-sde-next-rowid-in-t-sql/m-p/761990#M529</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The example in the documentation isn't saying, or even suggesting, you write the value down and then hard wire it into a query.&amp;nbsp; The example is trying to demonstrate that you need to retrieve the value first before using it later in a query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What about:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;DECLARE&lt;/SPAN&gt; &lt;SPAN class="variable token"&gt;@myval&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;int&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;EXEC&lt;/SPAN&gt; sde&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;next_rowid &lt;SPAN class="string token"&gt;'OWNER'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'MYTABLE'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="variable token"&gt;@myval&lt;/SPAN&gt; OUTPUT

&lt;SPAN class="keyword token"&gt;INSERT&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;INTO&lt;/SPAN&gt; MYTABLE
&lt;SPAN class="keyword token"&gt;SELECT&lt;/SPAN&gt; &lt;SPAN class="variable token"&gt;@myval&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; SITE_ID
&lt;SPAN class="keyword token"&gt;FROM&lt;/SPAN&gt; OWNER&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MYVIEW&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:22:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/using-sde-next-rowid-in-t-sql/m-p/761990#M529</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2021-12-12T08:22:27Z</dc:date>
    </item>
    <item>
      <title>Re: Using sde.next_rowid in T-SQL</title>
      <link>https://community.esri.com/t5/geodatabase-questions/using-sde-next-rowid-in-t-sql/m-p/761991#M530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joshua, thanks for the answer. &amp;nbsp;I've been out of the office and am now getting back to this, I'll give this a try and let you know. &amp;nbsp;This is the 10.5 documentation that I was referring to, but your example may help for sure.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/357092_pastedImage_1.png" style="width: 620px; height: 324px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jun 2017 18:06:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/using-sde-next-rowid-in-t-sql/m-p/761991#M530</guid>
      <dc:creator>SherrieKubis</dc:creator>
      <dc:date>2017-06-14T18:06:31Z</dc:date>
    </item>
    <item>
      <title>Re: Using sde.next_rowid in T-SQL</title>
      <link>https://community.esri.com/t5/geodatabase-questions/using-sde-next-rowid-in-t-sql/m-p/761992#M531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Joshua,&amp;nbsp;&lt;/P&gt;&lt;P&gt;You example worked great for the first row. &amp;nbsp;For example, the sde.next_rowid returns as 30279. &amp;nbsp;The first row entered has an object id of 30279. &amp;nbsp;The insert statement has 33,000 rows to add, but this doesn't get the next row id, it uses objectid. &amp;nbsp;So it would have to be in a loop, as shown in this article:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://support.esri.com/technical-article/000012317" title="http://support.esri.com/technical-article/000012317"&gt;How To: Insert geometry from XY coordinates using SQL&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I don't want a loop, I want set processing as opposed to iterative.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, in Oracle the statement&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; border: 0px; font-size: 14px;"&gt;INSERT INTO MYTABLE (OBJECTID, SITE_ID)&amp;nbsp;&lt;/SPAN&gt;&lt;BR style="background-color: #ffffff;" /&gt;&lt;SPAN style="background-color: #ffffff; border: 0px; font-size: 14px;"&gt;SELECT SDE.GDB_UTIL.NEXT(ROWID ('OWNER','MYTABLE'), SITE_ID FROM MYVIEW;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inserts into MYTABLE the uniqueid from next_rowid for all 33,000 rows.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jun 2017 18:30:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/using-sde-next-rowid-in-t-sql/m-p/761992#M531</guid>
      <dc:creator>SherrieKubis</dc:creator>
      <dc:date>2017-06-14T18:30:07Z</dc:date>
    </item>
    <item>
      <title>Re: Using sde.next_rowid in T-SQL</title>
      <link>https://community.esri.com/t5/geodatabase-questions/using-sde-next-rowid-in-t-sql/m-p/761993#M532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looking back, I forgot to ask, is this versioned data?&amp;nbsp; You said it is registered but didn't explicitly say whether it was versioned or not.&amp;nbsp; If it is versioned, then you can use the versioned view to do the inserts and it does the OBJECTID for you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jun 2017 19:10:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/using-sde-next-rowid-in-t-sql/m-p/761993#M532</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2017-06-14T19:10:52Z</dc:date>
    </item>
    <item>
      <title>Re: Using sde.next_rowid in T-SQL</title>
      <link>https://community.esri.com/t5/geodatabase-questions/using-sde-next-rowid-in-t-sql/m-p/761994#M533</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, it is not versioned. &amp;nbsp;&lt;/P&gt;&lt;P&gt;I've simplified it to taking a non-registered table and inserting into a registered table with an objectid. &amp;nbsp;&lt;/P&gt;&lt;P&gt;Same problem, but trying to make it clearer. &amp;nbsp;&lt;/P&gt;&lt;P&gt;Goal: Populate a target table of 4 columns. 3 columns come from another table, 1 column is derived from a (third-party) stored procedure. For performance reasons I want to use set processing, not cursors or iterative processing.&lt;/P&gt;&lt;P&gt;S‌ource Table: county_source &lt;BR /&gt; ‌ county varchar(3)&lt;BR /&gt; ‌ countyname varchar(12) &lt;BR /&gt;‌‌&lt;BR /&gt;T‌arget Table: county_target&lt;BR /&gt; ‌ county va‌rchar(3) &lt;BR /&gt; ‌ countyname varchar(12) &lt;BR /&gt; ‌ objectid int&lt;/P&gt;&lt;P&gt;T‌he objectid for each row comes from a stored procedure, like so:&lt;BR /&gt;EXEC sde.next_rowid 'OWNER', 'COUNTY_TARGET', @objectid OUTPUT;‌&lt;/P&gt;&lt;P&gt;I need to insert into county_target with an objectid, where one of the columns come from the stored &lt;BR /&gt;procedure. The insert will be a select from county_source.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;The code that I am using is wrong as the stored procedure doesn't fire.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DECLARE @objectid as INT &lt;BR /&gt;declare @sql as varchar(100)&lt;BR /&gt;declare @owner as varchar(10) = 'SDECREATOR'&lt;BR /&gt;declare @table as varchar(25) = 'County_Target'&lt;BR /&gt;set @sql = 'exec sde.next_rowid, @owner, @table, ' + convert(varchar(5),@objectid) + 'OUTPUT';&lt;/P&gt;&lt;P&gt;INSERT INTO [SDECREATOR].[County_Target]&lt;BR /&gt; (OBJECTID, COUNTY, COUNTY_NAME) &lt;BR /&gt; SELECT @sql, &lt;BR /&gt; COUNTY,&lt;BR /&gt; COUNTY_NAME &lt;BR /&gt; FROM [SDECREATOR].[County_Source];&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jun 2017 19:45:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/using-sde-next-rowid-in-t-sql/m-p/761994#M533</guid>
      <dc:creator>SherrieKubis</dc:creator>
      <dc:date>2017-06-27T19:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: Using sde.next_rowid in T-SQL</title>
      <link>https://community.esri.com/t5/geodatabase-questions/using-sde-next-rowid-in-t-sql/m-p/761995#M534</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found a work around in another post that I can't find anymore. Basically you create a temporary table to store the OBJECTIDS, perform a join with your table, &amp;nbsp;and then perform the insert. &lt;SPAN style="background-color: #ffffff;"&gt;This approach works well for a small number of records but becomes slow for larger sets (&amp;gt;100,000). I use this approach often so if you can think of improvements please share.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;------------------------------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;declare @OBJECTID int&lt;BR /&gt;declare @ids table(&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;OBJECTID INT&lt;BR /&gt;)&lt;BR /&gt;declare @RowCnt int&lt;BR /&gt;declare @MaxRows int&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select @MaxRows = count(*) from INPUT_TABLE&lt;BR /&gt;select @RowCnt = 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while @RowCnt &amp;lt;= @MaxRows&lt;BR /&gt;begin&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;EXEC sde.next_rowid 'OWNER', 'TABLENAME', @OBJECTID OUTPUT&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;insert into @ids (OBJECTID) values(@OBJECTID)&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;Select @RowCnt = @RowCnt + 1&lt;BR /&gt;end&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;insert into TARGET_TABLE(OBJECTID, COLUMN1, COLUMN2, COLUMN3)&lt;BR /&gt;select&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;ids.OBJECTID,&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;COLUMN1, COLUMN2, COLUMN3&lt;BR /&gt;from (&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;select&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ROW_NUMBER() OVER(ORDER BY (select null)) AS RowNumber,&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;COLUMN1, COLUMN2, COLUMN3&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;from INPUT_TABLE&lt;BR /&gt;) as attr &lt;BR /&gt;join (&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;select&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*, &lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ROW_NUMBER() OVER(ORDER BY [objectid]) AS RowNumber&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;from @ids &lt;BR /&gt;) as ids&lt;/P&gt;&lt;P&gt;on attr.RowNumber = ids.RowNumber&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Aug 2017 15:35:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/using-sde-next-rowid-in-t-sql/m-p/761995#M534</guid>
      <dc:creator>AlexMagruder</dc:creator>
      <dc:date>2017-08-02T15:35:04Z</dc:date>
    </item>
    <item>
      <title>Re: Using sde.next_rowid in T-SQL</title>
      <link>https://community.esri.com/t5/geodatabase-questions/using-sde-next-rowid-in-t-sql/m-p/761996#M535</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All&lt;/P&gt;&lt;P&gt;I just started looking into this as we are starting to try some new things here using sql server to create new features.&amp;nbsp; We did some experimenting last week and we were able to get something to work.&amp;nbsp; Once I started reading some documentation I am a little concerned that we may get into trouble in the future.&amp;nbsp; What we are doing is creating an inner join in sql using a table and a feature class.&amp;nbsp; We then output the matching records to a non-versioned feature class using the shape from the feature class used in the join.&amp;nbsp; We are using a recid identity field to write into the objectid of the output feature class.&amp;nbsp; What we do is truncate the output feature class before inserting the new records.&amp;nbsp; It has been running every 2 minutes for the last week and seems to be functioning like we want.&amp;nbsp; Everything I read says to not mess with the ObjectID, but the workaround using "next_rowid" seems a little much if we are using an Identity field from another table.&amp;nbsp; Has anyone experienced what may happen when you insert values into an objectid of a non-versioned feature class if it is truncated prior to the insert?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Sep 2017 14:20:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/using-sde-next-rowid-in-t-sql/m-p/761996#M535</guid>
      <dc:creator>MarkYerington</dc:creator>
      <dc:date>2017-09-15T14:20:14Z</dc:date>
    </item>
    <item>
      <title>Re: Using sde.next_rowid in T-SQL</title>
      <link>https://community.esri.com/t5/geodatabase-questions/using-sde-next-rowid-in-t-sql/m-p/761997#M536</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Alex, I'll keep this handy. I've been pulled away from this issue and haven't been able to get back to it, but I'd like to try it. &amp;nbsp;I'll update when I get back to that point.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Sep 2017 14:35:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/using-sde-next-rowid-in-t-sql/m-p/761997#M536</guid>
      <dc:creator>SherrieKubis</dc:creator>
      <dc:date>2017-09-15T14:35:51Z</dc:date>
    </item>
    <item>
      <title>Re: Using sde.next_rowid in T-SQL</title>
      <link>https://community.esri.com/t5/geodatabase-questions/using-sde-next-rowid-in-t-sql/m-p/761998#M537</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mark. &amp;nbsp;I'm curious to see how this works in the long term. &amp;nbsp;I'm coming from Oracle, where updating the objectid is easier because the next_rowid is a function. &amp;nbsp;We've been using SDE there for a very long time, and from experience, my biggest rule is to never mess with SDE from SQL, always use SDE to do the work. &amp;nbsp;There are so many inter-dependencies in the GDB and metadata tables that you may think you're okay, and then all of a sudden realize an issue is cropping up. &amp;nbsp;I used to try and go around SDE for performance and ease of use, but vowed to abandon that idea after we had to recover the database back to a point-in-time before I touched it. &amp;nbsp;I don't have enough experience with SDE and MS SQL yet to comment, but I'm interested in what others have to say.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sherrie&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Sep 2017 14:41:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/using-sde-next-rowid-in-t-sql/m-p/761998#M537</guid>
      <dc:creator>SherrieKubis</dc:creator>
      <dc:date>2017-09-15T14:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: Using sde.next_rowid in T-SQL</title>
      <link>https://community.esri.com/t5/geodatabase-questions/using-sde-next-rowid-in-t-sql/m-p/761999#M538</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes that was always our rule of thumb too.&amp;nbsp; We had some old sql DBAs that tried to back door GIS and really screwed things up.&amp;nbsp; That was probably 15 years ago and before using sql geometry.&amp;nbsp; I think using sql geometry has really opened the door to opportunities.&amp;nbsp; The reason that we had to do this was because there is such an overhead with ESRI joins using map services and the operations dashboard.&amp;nbsp; We are using the operations dashboard to view electrical outage information coming from our CIS system.&amp;nbsp; There are multiple widgets on our dashboard updating every 2 minutes.&amp;nbsp; When doing the join through esri the update was happening on all 7 widgets every 2 minutes&amp;nbsp; and our sql server (server) was overwhelmed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One good thing I guess is not having to recover this information as it is updated every 2 minutes and the only thing that comes from esri is the shape of the points.&amp;nbsp; Doing the join once on the sql side and writing the data to a feature class has optimized the operation dashboard greatly and reduced overhead.&amp;nbsp; Doing the join with esri was trying to match 12,000 meters in 7 different widgets every 2 minutes and was a huge bottleneck.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hopefully it will continue to run and not cause issues, I can't believe they don't have a sql function that will operate like oracle.&amp;nbsp; We do not have to edit the data so unregistering as versioned removes a lot of the interdependence.&amp;nbsp; I guess if we have to we can try to create the ObjectID using an iterator and a loop, but adds a lot of logic over what we currently have in place.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Sep 2017 16:16:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/using-sde-next-rowid-in-t-sql/m-p/761999#M538</guid>
      <dc:creator>MarkYerington</dc:creator>
      <dc:date>2017-09-15T16:16:12Z</dc:date>
    </item>
  </channel>
</rss>

