1

I am using ArcPy to run through all of the spatial views in an enterprise GDB, register them with the GDB, and assign domains to the registered view. It runs great for most of the views in the GDB, but 5 of our 35 views fail with the titular error.

I've tried several suggested fixes, including

  • Turned off background geoprocessing
  • Cleared temp folder C:\Users\\AppData\Local\Temp
  • Checked additional log files (e.g., C:\Users\\AppData\Local\ESRI): empty
  • Check for NULL geometries in underlying SQL tables: don't have any
  • Exported view to shapefile (Feature class to feature class): it's valid
  • We don't have any user-defined data types
  • Deleted and recreated view
  • CAST bit to smallint for "Repaired" column in CREATE VIEW statement

RDBMS - MSSQL, version 14.0.17289.0

SDE - SQL Server Enterprise Geodatabase, version 10.5.1

Attempting to register manually within ArcMap, here's an example input

Attempting to register manually within ArcMap, here's an example input

And the fields used in this view

example of the fields in this view

And the SQL data type definitions

SQL data type definitions

View definition with CAST from bit to smallint

View definition with CAST from bit to smallint

9
  • 1
    The bit datatype isn't directly supported by ArcGIS. The doc indicates the bit should be "viewable", but registering it is a deeper level of complexity. You can try casting it to smallint in view creation.
    – Vince
    Nov 25, 2019 at 17:41
  • No dice. In my CREATE VIEW statement, I used CAST(CR.Repaired AS smallint) AS Repaired
    – avstjohn
    Nov 25, 2019 at 18:26
  • 1
    It's not an issue of whether the database is geodatabase-enabled (which is the term of art -- 'SDE' no longer exists), just that it's in a different database. I remember there being a reason why this cannot be supported, but don't remember the particulars (this would be an issue for Esri Tech Support).
    – Vince
    Nov 25, 2019 at 18:43
  • 1
    I got on with support, and the issue was unrelated to all of the above information. The SQL data type "date" is not supported by Esri. Changed to "datetime" in SQL, and they register now!
    – avstjohn
    Nov 25, 2019 at 20:18
  • 1
    An example of infamous esri's "catch all and return silly error code" error handling. Try to check if geometries are valid, e.g. SELECT * FROM TABLE_OR_VIEW WHERE Shape.STIsValid()=0 Nov 26, 2019 at 16:15

1 Answer 1

2

Closing this question. Word of advice: check you SQL data types, as unsupported types, such as "date" can cause ERROR 999999.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.