DMS2

Changing SDE data source using Python:  query layers vs feature layers

Discussion created by DMS2 on Jul 28, 2016
Latest reply on Jul 28, 2016 by DMS2

I have a bunch of MXD and I need to change the SDE connection in them using Python. These MXD include sde feature layers, sde tables and query layers.

For sde feature layers and tables replaceWorkspaces work as expected but it does not for query layers.

I tried with findAndReplaceWorkspacePaths and it works for query layers but NOT for sde feature layers.

So I guess I should combine both methods to get all the layers' connections changed, but this means changing the data source twice for every MXD. Isn't there a single method to do this all at once? I need all the process to be as fast as possible.

Outcomes