Changing Binary to Geometry?

1976
2
Jump to solution
01-09-2020 09:45 AM
LorindaGilbert
Occasional Contributor II

Hi All,

Have just been attempting to create some views in my SDE(s) and it is failing.  I'm attempting to create a new column in the view that is a calculation on the length of the segment for streets to be used in a dashboard since Arcade can't be used there yet.  Part of the view is Select ... streets.object_id, streets.shape, streets.shape.len, (streets.shape.len/5280) centerlinemiles from ....

Error message is:  Cannot call method on int.  When I look at my base table in SSMS in design mode, for the Shape column it is showing int rather than geometry or geography.  I believe that this is referring to binary.

As a test, I copied the same feature class into a new test db and it came in as geometry and the select statement works after changing the shape.len to shape.STLength().  This was a V10.6.1 geodatabase.

The original database was created in 9.0 (or even 8.2) many years ago and upgraded to 10.0 and then 10.3.1.  I believe that this is part of the issue.

Using information from another thread asking how you can tell which version you are using, I have found a mixture of geometry and binary in the SAME database!  Didn't think this was possible.

So is there a way to convert the entire database to the same - likely geometry (we are using state plane coords) or best recommended?

I do see one way of doing it, create a new db on another server (want to maintain the same name and since ESRI doesn't allow for renaming of the db...), then copy all of the data into this new db, then recreate any replicas that allow for updates of deltas.  But this seems to be a long drawn out process.  I'm thinking this needs to be done on all of our databases.

Thanks,

Lorinda

0 Kudos
1 Solution

Accepted Solutions
George_Thompson
Esri Frequent Contributor

You can have a mix of geometry types in the EGDB like SDEBINARY and SQL Server Geometry.

You need to run this tool; Migrate Storage - Migrate Storage—Help | ArcGIS Desktop on the SDEBINARY feature classes to up them in place. There is no need to create a new DB for this.

More information on the process:  Data migration from one storage type to another—Geodatabases in Oracle | ArcGIS Desktop

I would recommend taking a full verified backup before running this process as a precaution.

Geodatabase

--- George T.

View solution in original post

0 Kudos
2 Replies
George_Thompson
Esri Frequent Contributor

You can have a mix of geometry types in the EGDB like SDEBINARY and SQL Server Geometry.

You need to run this tool; Migrate Storage - Migrate Storage—Help | ArcGIS Desktop on the SDEBINARY feature classes to up them in place. There is no need to create a new DB for this.

More information on the process:  Data migration from one storage type to another—Geodatabases in Oracle | ArcGIS Desktop

I would recommend taking a full verified backup before running this process as a precaution.

Geodatabase

--- George T.
0 Kudos
LorindaGilbert
Occasional Contributor II

Thanks, yes, upon further investigation, I did see how this happened and see that it was because we started our SDEs with a pre 9.3 version.  Have also found how to update, thank you python scripting and data models, and it appears that if I select a feature dataset that has some data already at GEOMETRY that it will not complain.  We are using SQL Server.

Now we have to make a concerted effort to put the dbs in the proper order for update.  I'm reasonable certain that the replicas in the child dbs will have to be recreated to accommodate the storage change.  If anyone knows differently, please tell me! 

Which since we are also implementing editor_tracking that will also necessitate the recreation of replicas.  I've yet to find an effective way of updating replicas.  And we will be moving data around in datasets, so lots of changes coming to an SDE near you (at least for me!).  My database migration project just went crazy!  And then afterwards, desktop upgrades along with introducing Pro!

Thanks,

Lorinda

0 Kudos