I am trying to read my SDE database and then delete specific feature classes if they exist...
I keep getting error below....not sure whats up....do I need to make a different connection to the db?
ExecuteError: ERROR 000601: Cannot delete C:/GIS_Scripts/Update/OS@Connection.sde/database.DBO.FEATURES_update. May be locked by another application.
Failed to execute (Delete).
def main():
sqlPath = r"C:/GIS_Scripts/Update/OS@Connection.sde/"
fc_Delete = ["database.DBO.FEATURES_update","fc_Out2a"]
for fc in fc_Delete:
fc_path = os.path.join(sqlPath, fc)
print fc_path
if arcpy.Exists(fc_path):
arcpy.Delete_management(fc_path)