0

I have a polygon feature class inside of my geodatabase, and I want to attach attributes from some tables that resides in a separate database. Is there any way to do this that would maintain the relationship?

I have it working with joins, but that doesn't keep the relationship inside of the feature class.

3
  • If they are in completely different workspaces/databases you cannot store it in a file geodatabase. For a file geodatabase containing only half of the data you can only create joins and relates that are layer based. I believe the Join can be saved either as part of a layer within a map or as part of a layer file. I don't think a relate can be stored any way outside of a layer within an actual map. SDE may have more options, but I don't have any experience with those possibilities. If Views actually can somehow work with File Geodatabases I would like to know how to set that up. Dec 10, 2015 at 18:39
  • You are right. I can export the data, and all of the attributes will come with it, and it will be saved as a feature class. But, I want to set up something that will be updated on the fly, so that I don't have to overwrite my feature class every time there is a change in one of the original tables.
    – Eric
    Dec 10, 2015 at 18:44
  • Just FYI, after some testing I found that relates can actually be stored in a layer file if the relate set up pointed to the data source feature class/table directly. If the Relate set up was created between two layers added to the same map, I believe you could only save that relate through a group layer that included both layers. Dec 10, 2015 at 19:00

1 Answer 1

1

Depending on what database type are you using, it can be pretty easy to set up.

If it's an enterprise geodatabase, you can create a view to join the tables.

CREATE VIEW view_name AS

SELECT column_name(s)

FROM table_name

WHERE condition

If it's a personal or file geodatabase, views are not supported.

3
  • I don't think that will work. I am trying to use information that is generated into tables from our accounting software, so it's on a completely separate database. I will look into Views some more, but I'm not sure it will work.
    – Eric
    Dec 10, 2015 at 18:20
  • Depending on permissions and setup it can. We have a view that is set up between two different databases. I will try to grab more details later today.
    – MaryBeth
    Dec 10, 2015 at 18:37
  • stackoverflow.com/questions/17951320/… Though you may want to perform your own search on the type of databases you are using.
    – MaryBeth
    Dec 10, 2015 at 20:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.