I have an MXD. It connects to about 30 layers in one of our SDE databases. I want to change the SDE database they connect to. Is there a way to do this without having to right-click every layer and change it individually?
|
Right Click on the mxd in ArcCatalog, Click on Set data sources, and bulk change from there. However, this tool warns: "Note: this dialog is intended primarily for preparing map documents for publication. Customizations (VBA code, UI Controls and custom toolbars), graphs, and table window appearance properties are removed from .mxd files when you update their data sources using this dialog. To preserve these, update the data sources in ArcMap instead." You could also use the arcpy.mapping python library: http://resources.arcgis.com/en/help/main/10.1/index.html#//00s30000004p000000 |
||||
|
|
If you are using ArcGIS 10 and are interested in using Python, check out the help on Updating and fixing data sources with arcpy.mapping and the methods of the Layer object. Example:
If your layers don't all source the same original connection file, or the destination feature class name is different on the new SDE, you might need to use |
|||
|
|
This will remove all the red exclamation mark containing layers in the MXD and will point to the new created data source. In one go you can do this; no need to go and click each time on the red exclamation mark and clicking and setting the data source. |
|||||||
|