Hi there -
Is it possible to, using arcpy, to edit the content of an *.sde connection file (or files) directly?
Based on some initial research, it seems this is not possible and that the closest I might be able to get would be to use CreateArcSDEConnectionFile_management to generate multiple new files at once.
Thanks.
Solved! Go to Solution.
Once you have the original, you can make a connection to it.
env.workspace = "path and name of connection file . sde"
Then you can recover the properties of that connection file using Describe.
What are your requirements to edit a connection file?
I think you are correct, you could read a connection file, create a new one, then overwrite the original.
All that's needed is to swap out the server domain name in the *.sde files, but there are lots of *.sde files to update.
What would be the best arcpy function to use to read properties of the existing *.sde files?
Thanks so much for your quick reply.
Once you have the original, you can make a connection to it.
env.workspace = "path and name of connection file . sde"
Then you can recover the properties of that connection file using Describe.
Great, thanks again for all the information.
Hi Mike,
Kim at dec was asking the same question via email to me. Haven't made contact yet. Is thus related? I mentioned you just asked the question here.
just FYI, for finding and updating other broken link, I had an addin Python addin for data inventory and “broken-link” repair. Not 100%, and haven't had time to keep working on it, but may help fix other issues in the future.