Question

Error writing to an SDE database: SDE_Error_CODE(-218)

  • 19 March 2015
  • 3 replies
  • 12 views

Badge
I am trying to write data to an SDE Geodatabase, but am unable to do so. I am running FME 2015, ArcGIS 10.2.2, my SDE database is in 10.2.2, and I'm on SQL Server. I am able to write the file into an 'older' (it's less than a year old same version and on the exact same SQL database) SDE database, but when I try and change it to write to the 'newer' SDE database on the exact same server I get the following error...

 

 

"Error creating table 'Property_Owners'.: SDE_ERROR_CODE(-218) Table already registered. SDE_STREAM_ERROR_CODE(-51) SDE_EXT_ERROR(2617) SDE_ERROR_MSG1([Microsoft][SQL server Native Client 11.0][sQL Server]Violation of UNIQUE KEY constraunt 'registry_uk2'. Cannot insert duplicate key in object 'sde.SDE_table_registry'. The duplicate key value is (PROPERTY_OWNERS, BOZEMAN, BOZEMAN).) SDE_EXT_ERROR_MSG2()"

 

 

There is nothing in the new geodatabase with the same name or even anything close to it. Therefore, I'm not understanding the "Table already registered". I'm just not understanding why it is working for one of the SDE geodatabases but not the other.

 

 

Any suggestions would be greatly appreciated.

3 replies

Badge
Check the SDE.sde_Table_Registry table. That will contain all the tables that SDE  'thinks" is in the database. Also, are you creating the table and loading data or just loading into an existing table? If you are loading into an existing check the writer parameter for Table Exists.
Userlevel 4
Hi,

 

 

good tip from Sean.

 

 

Is it possible that the table already existed, but that it was deleted using a DROP TABLE rather than using e.g. ArcCatalog? That could explain the orphaned feature class metadata.

 

 

David
Badge
Thanks for your responses Sean and David. I really appreciate the feedback. At this point I'm simply trying to create a brand new Feature Class. Eventually, after I get this working, I want this routine to run nightly to update the table, but we are not there yet. The table does not exist in the SDE.sde_Table_Registry table, so I know it doesn't already exist. I also can't find any other sign of the table in SQL. This routine was actually created a few years ago by someone else. It was run on ocasion, but not used that frequently. Since that time we have upgraded to a new server as well as a ArcSDE 10.2.2 database (from 9.3.1). That said, I'm writing to a brand new (clean) SDE database. Since the routine was created with an older version of FME (I think it was 2013 but I'm not certain) I went ahead and created a new routine with a brand new writer in FME 2015. This time I was able to get it to run. At first I was not able to see the table in SQL. I had IT check and they could, so I had them change the permissions for the table and I'm now able to see it in SQL Managment Studio, so I know the table exists (this is another permissions issue I will have to resolve eventually). I'm afraid I still can't see it in ArcCatalog though. It appears that it has something to do with the way I configure the writer? I am using the Direct Connect (http://fmepedia.safe.com/articles/FAQ/How-do-I-connect-to-my-ArcSDE-Geodatabase-using-Direct-Connect) resource. The only issue with that is there is no "Database" field in my Parameters. Otherwise it appears that I am setting it up correctly. Hopefully this makes sense. Thanks again!

Reply