I am doing a cleaning up project for some of my data. This requires a data structure.

That means I will have to replace the workspace path in the MXDS.

The old structure of the data will be something as follows:


With the new structure being:


I believe it possible to use map document or layer find and replace workspacepath. If I do this though will this effect layer settings such as definition queries?

I have read in the scripting for ArcGIS ESRI book the following:

When workspaces in a map document are modified, there are a few things that MAY NOT WORK joins and relates associated with raster layers. Definition Queries MAY no longer work because of slightly different SQL syntax (then gives an example of FILE GEODATABASES to Personal Ones).

If I am just making straight change for the location of the data like a shapefile in a new location or file geodatabase in a new location, will this effect definition queries that might be stored in maps?

  • 2
    I think you should be fine as long as the data is exactly the same that you are re-linking/mapping to, eg data type (point, line, poly) and attributes. It would also help to have "Store relative pathnames to data source" box checked to help with remapping the data. – TsvGis Jun 3 '15 at 22:37
  • 1
    The definition query issue is related to the fact that def queries are only valid for certain kinds of underlying databases, since they can use different SQL syntax (meaning some SQL functions don't work in file geodatabase, but do in a personal geodatabase - so it depends on your query). Take my answer at gis.stackexchange.com/questions/141099 for example. That def query uses a nested query, which would work if the data is in a geodatabase but not if moved to a shapefile. I believe that's solely a SQL/database issue, not a pathing one. – Chris W Jun 4 '15 at 5:42

If you are moving a shapefile or file geodatabase feature class that is the source of a layer to a new location, and then you change the source of that layer to be the same shapefile or file geodatabase feature class in that new location then the definition query will still work.

If you are changing the source of a layer to a different shapefile or file geodatabase feature class then it will depend on whether the SQL used by the definition remains valid. For example, a field used by the definition query may not exist or be spelled the same in that or file geodatabase feature class.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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