I have a folder with several .SDE connections. I want my Python code to execute various SDE maintenance procedures (such as compress) on each of these databases. If there is a bad/corrupt/not permissioned .SDE file in the workspace, the process doesn't execute on any of the other databases either. How do I get it to attempt to compress each database in the workspace, even if one fails?
import arcpy
arcpy.env.workspace = "F:/Scripts/DatabaseConnections"
workspaces = arcpy.ListWorkspaces("*", "SDE")
try:
for workspace in workspaces:
arcpy.Compress_management(workspace)
except:
arcpy.GetMessages()