I have created a spatial view in SQL Server that has a not null constraint on a primary key field.
When I try to register this view with the geodatabase I receive an error code 999999.
Error message: The column must not have a NOT NULL constraint.
I cannot find this restriction in any of the ESRI documentation.
Since a field can be set to NOT NULL in SDE I don't understand why is error occurs?
Is this a bug?
If not can someone point me to any documentation that discusses this?
SQL Server 2014 (SP3) on Windows Server 2012
ArcDesktop 10.7.1 on Windows 10 (64 bit)
Did you ever figure this out? I don't have an answer, but I can tell you that registering a table or view with the geodatabase alters the schema. What type of field is your primary key? It has to be a unique integer.
You might have seen this before, but here is how the ArcGIS data types map to those of SQL Server: DBMS data types supported in ArcGIS—Help | Documentation .
I've had issues with non-supported data types before. SQL Server's BIGINT, for example.
We actually encountered this issue yesterday. It turns out, the shape column had a NOT NULL constraint on it. It must be configured to allow nulls.
Unfortunately, Esri's 999999 error message did not specify which column it was referring to, so we had to go down the rabbit hole of figuring that one out. I also can't find any Esri documentation that states that this is a requirement of the shape field. Another failure of Esri's documentation.
Esri, if you are going to provide an error message, please provide documentation on how to fix it. I'd also recommend not giving general 999999 error message when the error message clearly lists a specific error. It's not a general error if the error message knows what the problem is.