<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to delete an sde file with  Python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-delete-an-sde-file-with-python/m-p/50239#M3938</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what&amp;nbsp; I did:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: small;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #6f008a; font-family: Consolas; font-size: small;"&gt;os&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #6f008a; font-family: Consolas; font-size: small;"&gt;path&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;.exists(sdeFile):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: small; font-family: Consolas; "&gt;# removing the file using the os.remove() method&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #6f008a; font-size: small; font-family: Consolas; "&gt;os&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt;.remove(sdeFile)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Feb 2020 19:04:42 GMT</pubDate>
    <dc:creator>JoseSanchez</dc:creator>
    <dc:date>2020-02-25T19:04:42Z</dc:date>
    <item>
      <title>How to delete an sde file with  Python</title>
      <link>https://community.esri.com/t5/python-questions/how-to-delete-an-sde-file-with-python/m-p/50237#M3936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I delete an sde file located in my scratch space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;prefixOutputWorkspace = r"C:\scratch\....\ConnectionToSQL.sde"&lt;/P&gt;&lt;P&gt;if arcpy.Exists(prefixOutputWorkspace):&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; delete this sde conection &lt;/P&gt;&lt;P&gt;Recreate sde connection&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Feb 2020 16:47:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-delete-an-sde-file-with-python/m-p/50237#M3936</guid>
      <dc:creator>JoseSanchez</dc:creator>
      <dc:date>2020-02-25T16:47:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to delete an sde file with  Python</title>
      <link>https://community.esri.com/t5/python-questions/how-to-delete-an-sde-file-with-python/m-p/50238#M3937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can always use &lt;A class="link-titled" href="https://docs.python.org/2/library/os.html#os.remove" title="https://docs.python.org/2/library/os.html#os.remove"&gt;15.1. os.remove() — Miscellaneous operating system interfaces — Python 2.7.17 documentation&lt;/A&gt; to remove files on the file system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or, if you want to stay within ArcPy modules:&amp;nbsp; &lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/delete.htm" title="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/delete.htm"&gt;Delete—Data Management toolbox | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;SPAN style="color: #4c4c4c; font-family: 'Avenir Next W01', 'Avenir Next W00', 'Avenir Next', Avenir, 'Helvetica Neue', sans-serif; font-size: 15.9375px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;Deleting a database connection file does not delete the enterprise database. A database connection file is simply a shortcut to the database.&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Feb 2020 18:59:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-delete-an-sde-file-with-python/m-p/50238#M3937</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-02-25T18:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to delete an sde file with  Python</title>
      <link>https://community.esri.com/t5/python-questions/how-to-delete-an-sde-file-with-python/m-p/50239#M3938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what&amp;nbsp; I did:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas; font-size: small;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #6f008a; font-family: Consolas; font-size: small;"&gt;os&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #6f008a; font-family: Consolas; font-size: small;"&gt;path&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;.exists(sdeFile):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: small; font-family: Consolas; "&gt;# removing the file using the os.remove() method&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #6f008a; font-size: small; font-family: Consolas; "&gt;os&lt;/SPAN&gt;&lt;SPAN style="font-size: small; font-family: Consolas; "&gt;.remove(sdeFile)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Feb 2020 19:04:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-delete-an-sde-file-with-python/m-p/50239#M3938</guid>
      <dc:creator>JoseSanchez</dc:creator>
      <dc:date>2020-02-25T19:04:42Z</dc:date>
    </item>
  </channel>
</rss>

