Many times I have faced same problem as described in this post. During application deployment phase of we may need to change all the data-source path to prod database. Usually we dont have luxury of having ArcGIS Desktop/Catalog for updating the path or do some modifications on production environment. This is primarily because of additional license is required or production server will be entirely on other network or domain. Due to security reasons also ESRI ArcGIS is not allowed on prod environment. This becomes annoying when client wants to change the symbology or change the data source for some reasons.
One way to get rid of this issue is maintaining relative path on the mxd. If you want all your new maps to be stored with relative paths, go to the File > Document Properties dialog box and click the Data Source Options button. Check the option to make relative paths the default for new map documents. This setting is stored in the registry. If this box is not checked, the default is absolute paths. This will definitely save your effort.
You can still change the path if you have ESRI .NET assemblies installed and you need to write some scripts to achive the same.
But issue here is whenever you change the connection properties of SDE i.e. if you want to change password alone. Then it hurts more. Reading .sde file to get connection properties using AO is a not possible. You can get connection properties straight a way.
A simple way to get the connection properties that it contains is to use it to open the SDE workspace. Once the workspace is opened, you’ll be able to access the connection properties. Note, the password will remain encrypted – you won’t be able to see it in plain text. ESRI is NOT providing option to decrypt the password since by design as it as for security reason.
Long back I have faced one issue when I saved some layers for which the datasource is SDE feature classes. I ‘ve used an SDE connection without save password option. But still I got SDE Connection prompt when I open a map using IMapDocument interface. I could not supress this prompt programmetically, am not sure whether this issue is solved now.
You can click below link for read on usage of relative paths on MXD. Save a layers using relative path is optimal solution I would suggest for a developer for hassel free deployment.