I’ve created a spatial view in SQL Server 2014 in an enterprise geodatabase. When viewing this view in ArcMap, it acts as if it is in a non-spatial database (However, the database is enabled as enterprise geodatabase).
When adding this view to the dataframe, it asks about the ObjectID field, despite the fact that this filed is already available.
Moreover, all the enterprise management tools are greyed out (register as versioned, add global IDs,…..)
What might be the issue here?
This is better elaborated with the screenshots below,
Any help is highly appreciated
Solved! Go to Solution.
That error can also sometimes mean that the needed .Net Framework and/or C++ runtime libraries are not installed. But adding the install directory to the path is a good start.
Since a Direct Connect is required, it will also be necessary to set the SDEHOME environment variable to the install directory.
Using batch scripts is the easiest way to get there:
sdelayer -o register -l viewname,geomcolumn -e na+ -t GEOMETRY -R srid_of_base_table -C objectid,USER
Do NOT use 'sdetable -o create_view' -- ALWAYS define the view with SQL (or the Toolbox tool), then register it afterwards with 'sdelayer -o register'. Be sure to use a sensible name ("V" does not qualify, though "somedescriptivename_v" would).
Note: It's still possible that a 10.2.2 client will not be able to connect to SQL-Server 2014.
This is an expected behavior. I think you should read\research a bit more on this. There is a lot of discussions and Threads out there discussing this same thing.
To explain in brief....Starting from ArcGIS 10.1, Database Views can be created using ArcGIS Desktop, which like normal Views created from Database end, are not 'Registered with Geodatabase' or 'Registered with SDE'. This is why ArcGIS requests you to choose the Unique Identifier when you add the View to ArcMap. Instead if you create the View with SDE Command line tools, it automatically registers the View with ArcSDE and doesn't request you to choose the Unique Identifier.
The other scenario, where other than Analyze and Privileges, all other options are greyed out, that is expected as well. You cannot register a Database View as Versioned or do the other stuff listed under Manage. Have a look at the Online Links for more info.
Best practice is to create the view with SQL tools (or the Create Database View GP tool), then register the layer with ArcSDE via 'sdelayer -o register'.
'sdetable -o create_view' is only really intended for SDEBINARY storage geometry tables (where database-originated views are hampered by the Fn/Sn tables).
Views cannot have SDE-set rowids, and therefore cannot participate in geodatabase functionality (simple feature class only -- no "Register with Geodatabase")
May you please elaborate how I can "register the layer with ArcSDE via 'sdelayer -o register'"; I am not able to find a tool in Arctoolbox that performs this. Should this be done in ArcMap, or in SQL Server?
I am using ArcMap 10.3.1, and seems that the SDE command line is deprecated in this version; if so, what is the equivalent solution?
BTW, may you please provide me with some of the resources you mentioned above,
You can use SDE Command line 10.2.2 for now.
Otherwise, you can wait for the following Enhancement request to add this functionality:
ENH-000086635 : Add functionality to register database views with the geodatabase
I am still strugeling with registering this spatial view with the geodatabase. My main question is: How can I do this in ArcMap 10.3, if this is not possible at ArcMap level, how can I do it in SQL Server? May you please elaborate with steps due to my shallow experience with SQL Server and the SQL programming language itself?
Thank you in Advance,