Spatial view Problem

7411
16
Jump to solution
12-21-2015 03:29 AM
Highlighted
Occasional Contributor II

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,

Clip_1414.jpg

Clip_1415.jpg

Clip_1416.jpg

Any help is highly appreciated

Best Regards,

Hani

Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Esri Esteemed Contributor

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:

set SDEHOME=D:\Esri\arc102admin64-rel2\arcsde

set PATH=%SDEHOME%\bin;%PATH%

set SDEUSER=tableowner

set SDEINSTANCE=sde:sqlserver:servername

set SDEDATABASE=databasename

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.

- V

View solution in original post

16 Replies
Highlighted
MVP Frequent Contributor

I think you should show us the columns in the spatial view. Is the geometry set up properly?

Reply
0 Kudos
Highlighted
Regular Contributor III

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.

Highlighted
Esri Esteemed Contributor

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")

- V

Highlighted
Occasional Contributor II

Hi Vince,

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?

Best,

Reply
0 Kudos
Highlighted
Regular Contributor III

There is no tool to do this from ArcGIS Desktop. 'sdelayer -o register' is a part of the SDE Command line toolset.

ArcSDE Administration Command Reference

sdelayer

Highlighted
Occasional Contributor II

Dear Asrujit,

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,

Best,

Hani

Highlighted
Regular Contributor III

You can use SDE Command line 10.2.2 for now.

44300 - Can ArcSDE command line tools be used against 10.3 and newer geodatabases?

Otherwise, you can wait for the following Enhancement request to add this functionality:

ENH-000086635 : Add functionality to register database views with the geodatabase

Highlighted
Occasional Contributor II

Dear all,

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,

Best Regards,

Hani

Reply
0 Kudos
Highlighted
Regular Contributor III

You cannot do that using ArcGIS Deskop or using SQL Server. You will HAVE to you SDE Command line tools. Check the links I provided.