Select to view content in your preferred language

Spatial view Problem

11276
16
Jump to solution
12-21-2015 03:29 AM
HaniDraidi
Frequent Contributor

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

0 Kudos
16 Replies
HaniDraidi
Frequent Contributor

Hi Asrujit,

Still NOT able to run the commands above, I removed the 10.3.1 version, installed 10.2.2 version and the ArcSDE 10.2.2 Command Line Tools. However, the commands are still not recognized by CMD as shown below.

Are there any additional steps that I should do after finishing the installation?

Thanks in Advance,

Hani

Clip_1442.jpg

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

The error message you see implies one of two things:  1) you don't have the ArcSDE Command Line Tools installed, or 2) the ArcSDE Command Line Tools are installed but the system or user path was not updated to include the directory with the ArcSDE Command Line binaries.  Since you installed the tools, it seems you just have a path problem.  Since the current working directory is always in the user's path, I suggest navigating to the directory containing the binaries and try executing them from there.  If it works, you know what the issue is, and you can just add that directory to the system or user path.

VinceAngelo
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

HaniDraidi
Frequent Contributor

Many Thanks Vince!

It worked Finally!

May you please help me in registering a non-spatial views and tables?

0 Kudos
DanMcCoy
Frequent Contributor

"Coming at the 10.5 release the ‘Register with Geodattabase’ tool will be enhanced with additional parameters and allows database views as acceptable input datasets."

https://community.esri.com/ideas/8897#comment-42312 

RandyKreuziger
Frequent Contributor

I hope the "Register with Geodatabase" tool fixes most of the problem ESRI created.  I just encountered one with ObjectID that is going to require that I come up with a work around to keep many of my current scripts running!

In some databases we only have access to the spatial views and not the original data.  I need to create copies of these geodatasets in other geodatabases both SDE (aka Enterprise) geodatabase and a file geodatabases.  However, when copying a spatial view from one SDE database to another the spatial view created a physical feature class or just find.  But with database views at 10.4.1, the ObjectID in the view is not recognized so an additional ObjectID_1 field is created!   The schemas no long match and that breaks my workflow further downstream...

0 Kudos
Asrujit_SenGupta
MVP Regular Contributor

Randy  Can you please post this as a separate Question.

Also post a bit more info, like:

1. Did you "Register with Geodatabase' that View

2. Which ArcGIS Desktop version did you use to copy the View

3. Does Copy\Paste, Import\Export...all show the same result?

4. The configuration details that you have (SQL Server version, gdb version, etc)

This should help others to test and share their observations as well.