What arcpy function deletes ALL database connections in ArcCatalog?

  • 2
    There isn't one, of course, but you could easily walk the folder connections, searching for .sde suffix files. – Vince Jan 31 '18 at 13:00
  • 3
    Not sure why the close votes? The question asks what function. It doesn't say "how do I write code". Instead of voting to close, just answer the question as it is. – KHibma Jan 31 '18 at 13:18

There is no arcpy function to delete all database connections.

A database connection is simply a file on disk. It can live in any folder, but if you're in ArcCatalog and talking about multiple connections you're probably referring to the Database Connections node. That is a virtual path in ArcCatalog to an actual folder on disk.

If you want to remove these files you'll need to identify that directory in your profile and write your own code that has nothing to do with arcpy. Do a quick google search for python delete files in directory: the first answer is a helpful stack post.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.