Hello everyone,
How can I delete an sde file located in my scratch space.
prefixOutputWorkspace = r"C:\scratch\....\ConnectionToSQL.sde"
if arcpy.Exists(prefixOutputWorkspace):
delete this sde conection
Recreate sde connection
Thanks
You can always use 15.1. os.remove() — Miscellaneous operating system interfaces — Python 2.7.17 documentation to remove files on the file system.
Or, if you want to stay within ArcPy modules: Delete—Data Management toolbox | Documentation
Deleting a database connection file does not delete the enterprise database. A database connection file is simply a shortcut to the database.
Hi,
This is what I did:
if os.path.exists(sdeFile):
# removing the file using the os.remove() method
os.remove(sdeFile)