Sign up ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am running an ETL from a spatial view into publication database. The view has results in duplicate ObjectID's. I started working with the get_ids SP example from ESRI, but that seems to be built more for a single record insert and not a bulk insert. Here is my example...

DECLARE @id as integer
DECLARE @num_ids as integer
EXEC L.i16_get_ids 2, 1, @id output, @num_ids output; 

INSERT INTO L.TAXPARCELWCONDOS ([OBJECTID]
           ,[PARCELNO]
           ,[SHAPE])
SELECT @id
      ,[PARCELNO] ,[shape]
  FROM [Parcel].[L].[view_TaxParcelwCondos];
END

How can I generate new ObjectID's for the insert.

Thanks,

Dave

share|improve this question
    
Create a temp table with an identity column for Object ID. Insert the View there and then move that into the publication table. –  user29402 Apr 22 '14 at 16:09
    
CREATE TABLE #TAXPARCELWCONDOS( [OBJECTID] int identity(1,1) not null, [PARCELNO] [nvarchar](26) NULL, [SHAPE] [geometry] NULL) INSERT INTO #TAXPARCELWCONDOS ([PARCELNO] ,[SHAPE]) SELECT [PARCELNO] ,[shape] FROM [Parcel].[L].[view_TaxParcelwCondos]; TRUNCATE TABLE L.TAXPARCELWCONDOS; INSERT INTO L.TAXPARCELWCONDOS ([OBJECTID],[PARCELNO] ,[SHAPE]) SELECT [OBJECTID],[PARCELNO] ,[shape] FROM #TAXPARCELWCONDOS; DROP TABLE #TAXPARCELWCONDOS –  user29402 Apr 22 '14 at 18:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.