<?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: How to do bulk insert into Feature class from SQL - ObjectID's!! in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/how-to-do-bulk-insert-into-feature-class-from-sql/m-p/576032#M12980</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;&amp;gt;but obviously this only works for 1 row. My stored procedure could potentially be creating 800+ rows&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Perhaps I've misunderstood your problem but I think this statement isn't correct. Each time you call the stored procedure to get the next OBJECTID for a feature class it updates the table storing the OBJECTIDs so that the next time you call it the OBJECTID will always be one higher. Modify your stored procedure to add (for SQL Server):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;DECLARE @Object_ID int&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DECLARE @Num_IDs int&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;EXEC dbo.&lt;/SPAN&gt;&lt;STRONG&gt;i51&lt;/STRONG&gt;&lt;SPAN&gt;_get_ids 2, 1, @Object_ID OUTPUT, @Num_IDs OUTPUT&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;where you'd replace the 'i51' with the correct value for your feature class from the SDE_table_registry, and then use the @Object_ID variable in your INSERT statement.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 21 Nov 2011 08:01:21 GMT</pubDate>
    <dc:creator>AndrewCorcoran</dc:creator>
    <dc:date>2011-11-21T08:01:21Z</dc:date>
    <item>
      <title>How to do bulk insert into Feature class from SQL - ObjectID's!!</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/how-to-do-bulk-insert-into-feature-class-from-sql/m-p/576031#M12979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Apologies if this is in the wrong place, but i wasnt sure where to put it. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to populate a featureclass from within a sqlserver stored procedure, that i am calling via a webservice from within flex. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The reason i am doing this rather than a query task, is that the stored procedure brings in time data from a source outside of SDE. The idea is that I will have a mapservice that uses this feature class joined to a feature class that contains the geometry of the polygons i need to return. I can then create a featurelayer on the fly and use a featurecollection to create it (as per the GPX sample on the flexapi site). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem I am having is how to create the ObjectID's&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I found this link:&lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/in_SQL_Server/006z00000017000000/"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/in_SQL_Server/006z00000017000000/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;but obviously this only works for 1 row. My stored procedure could potentially be creating 800+ rows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;INSERT INTO gisadmin.MonthBookings_Temp&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;SELECT [objectid], t.GP22_AssetNumber, m.site_name,&amp;nbsp; m.VolDate, MAX(Actual_Users) AS [Actual_Users]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;FROM&amp;nbsp; cawdapt.synIRISWarehouse m, gisadmin.OTTERBURN_GP22TRAININGAREAS t&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;WHERE&amp;nbsp; m.facility_category collate Latin1_General_CI_AS&amp;nbsp; = 'Training Area'&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND m.Maximo_Asset_number IS NOT NULL &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND m.Region = '04'&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND m.site_name = @param1&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND MONTH(m.Voldate) = @param2&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND YEAR(m.VolDate) = @param3&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND m.Maximo_Asset_Number collate Latin1_General_CI_AS = t.GP22_AssetNumber&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND m.region collate Latin1_General_CI_AS = t.RAR_RegionCode&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;GROUP BY m.site_name, t.GP22_AssetNumber, m.Maximo_Asset_number, m.VolDate&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ORDER BY Voldate&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How do i write this statement so that I can create unique objectid's for every row i need to insert. Is this possible or am I doing this completely the wrong way?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope someone can help!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Oct 2011 09:09:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/how-to-do-bulk-insert-into-feature-class-from-sql/m-p/576031#M12979</guid>
      <dc:creator>grahamcooke</dc:creator>
      <dc:date>2011-10-25T09:09:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to do bulk insert into Feature class from SQL - ObjectID's!!</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/how-to-do-bulk-insert-into-feature-class-from-sql/m-p/576032#M12980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;&amp;gt;but obviously this only works for 1 row. My stored procedure could potentially be creating 800+ rows&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Perhaps I've misunderstood your problem but I think this statement isn't correct. Each time you call the stored procedure to get the next OBJECTID for a feature class it updates the table storing the OBJECTIDs so that the next time you call it the OBJECTID will always be one higher. Modify your stored procedure to add (for SQL Server):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;DECLARE @Object_ID int&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DECLARE @Num_IDs int&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;EXEC dbo.&lt;/SPAN&gt;&lt;STRONG&gt;i51&lt;/STRONG&gt;&lt;SPAN&gt;_get_ids 2, 1, @Object_ID OUTPUT, @Num_IDs OUTPUT&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;where you'd replace the 'i51' with the correct value for your feature class from the SDE_table_registry, and then use the @Object_ID variable in your INSERT statement.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Nov 2011 08:01:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/how-to-do-bulk-insert-into-feature-class-from-sql/m-p/576032#M12980</guid>
      <dc:creator>AndrewCorcoran</dc:creator>
      <dc:date>2011-11-21T08:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to do bulk insert into Feature class from SQL - ObjectID's!!</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/how-to-do-bulk-insert-into-feature-class-from-sql/m-p/576033#M12981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You saved me so much trouble. Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Additionally, you can set the next OBJECTID to be inserted in the table "dbo.&lt;SPAN style="background-color: #ffffff;"&gt;i51" with the column "last_id" (replacing i51 with the value from &lt;SPAN&gt;SDE_table_registry)&lt;/SPAN&gt;&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jun 2017 09:53:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/how-to-do-bulk-insert-into-feature-class-from-sql/m-p/576033#M12981</guid>
      <dc:creator>JoeyTuskan</dc:creator>
      <dc:date>2017-06-20T09:53:33Z</dc:date>
    </item>
  </channel>
</rss>

