nestasoft

Update Server name

Discussion created by nestasoft on May 2, 2012
Latest reply on May 3, 2012 by jbarrette-esristaff
It's possible to update the name of the server in a layer?

code :

for lyr in arcpy.mapping.ListLayers(myMXD):
    if lyr.supports("SERVICEPROPERTIES"):
            #Check the make sure the layer comes from and SDE database
            servProp = lyr.serviceProperties
            if lyr.serviceProperties["ServiceType"] == "SDE":
                print "    Serveur:      " + servProp.get('Server', 'N/A')
                lyr.serviceProperties["Server"] = "myNewServer"
                break

Outcomes