Select to view content in your preferred language

SDE.next_rowid failing in SQL*Server

101
4
Thursday
EdwardBlair
Frequent Contributor

Hi -

I'm trying to use sde.next_rowid to get an OID for a new row to be created in a table registered and versioned within a SQL*Server 10.8.1 geodatabase.   Here's my syntax:

DECLARE @next_oid AS BIGINT
EXEC sde.next_rowid 'gisadmin', 'ASSEMBLY', @next_oid OUTPUT

Here's the error I receive:

Msg 8144, Level 16, State 2, Procedure gisadmin.i36_get_ids, Line 0 [Batch Start Line 13]
Procedure or function i36_get_ids has too many arguments specified.

I'm afraid I'm stumped.  The syntax I'm using matches what has been documented here (https://community.esri.com/t5/geodatabase-questions/using-sde-next-rowid-in-t-sql/td-p/761989) and other places.  Any suggestions would be greatly appreciated.

Thx,

Ed

 

 

 

 

 

0 Kudos
4 Replies
DavidSolari
MVP Regular Contributor

Does declaring @next_oid as "int" rather than "bigint" change anything?

0 Kudos
EdwardBlair
Frequent Contributor

David -

Thanks for the reply.   I had tried using INT prior to BIGINT.   Same results.

Ed

EdwardBlair
Frequent Contributor

I looked for bugs related to this problem and Gemini told me this:

  • SQL Server Version: Problems with sde.next_rowid have been reported when using SQL statements to import data into an SQL Server SDE database, specifically with GeoDatabase version 10.8 and SQL Server version 2019.

Now, I'm using ArcGIS 10.8.1 with SQL*Server version 2022, and I have more than once had Gemini lead me on a wild goose chase, but... any chance anyone knows what "problems" might be referring to?

Thx,

Ed

0 Kudos
EdwardBlair
Frequent Contributor

So... as far as I can tell, this is a bug.   

However, I did find that another way to accomplish what I want to do is insert into the _EVW.    Below is SQL that worked for me.   Interestingly, the procedure "sde.next_globalid" works, while "sde.next_rowid" fails.   And, apparently,  when inserting into the _EVW the OBJECTID is generated as part of the "insert" operation.

DECLARE @GID uniqueidentifier
EXEC sde.next_globalid @GID OUTPUT
INSERT INTO ASSEMBLY_EVW (GLOBALID,PARENTOBJECTID,UNIT,SUBTYPECD,QUANTITY,DATECREATED)
VALUES (@gid,1408321,'UTSLV',5,1,GETDATE());

0 Kudos