<?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 Determine if SDE Connection is Available in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/determine-if-sde-connection-is-available/m-p/67183#M5492</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;To All SDE Python Users:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a way in python code to determine if an SDE connection is available or not?&amp;nbsp; I would like a scheduled task to check if SDE is available before attempting to extract data from SDE to a file geodatabase.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Sep 2012 14:23:27 GMT</pubDate>
    <dc:creator>MichaelVolz</dc:creator>
    <dc:date>2012-09-17T14:23:27Z</dc:date>
    <item>
      <title>Determine if SDE Connection is Available</title>
      <link>https://community.esri.com/t5/python-questions/determine-if-sde-connection-is-available/m-p/67183#M5492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;To All SDE Python Users:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a way in python code to determine if an SDE connection is available or not?&amp;nbsp; I would like a scheduled task to check if SDE is available before attempting to extract data from SDE to a file geodatabase.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Sep 2012 14:23:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/determine-if-sde-connection-is-available/m-p/67183#M5492</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2012-09-17T14:23:27Z</dc:date>
    </item>
    <item>
      <title>Re: Determine if SDE Connection is Available</title>
      <link>https://community.esri.com/t5/python-questions/determine-if-sde-connection-is-available/m-p/67184#M5493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;There might be a more eloquent solution than this....but off the top of my head&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
r = arcpy.CreateArcSDEConnectionFile_management("c:/temp","sde","ffoooo","411","SQLSERVER","DATABASE_AUTH","sde","*****","SAVE_USERNAME","#","SAVE_VERSION")

msgIndex = 0

while msgIndex &amp;lt; r.messageCount:
&amp;nbsp;&amp;nbsp;&amp;nbsp; if r.GetSeverity(msgIndex) == 1:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if '000565' in r.getMessage(msgIndex):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "cant connect"
&amp;nbsp; sys.exit()&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; msgIndex +=1
&amp;nbsp; 
# if you get this far, assumed connection is made...
&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; &lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:35:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/determine-if-sde-connection-is-available/m-p/67184#M5493</guid>
      <dc:creator>KevinHibma</dc:creator>
      <dc:date>2021-12-10T22:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: Determine if SDE Connection is Available</title>
      <link>https://community.esri.com/t5/python-questions/determine-if-sde-connection-is-available/m-p/67185#M5494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You could use the ArcSDESQLExecute command to check your connection:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//018z0000007z000000"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#//018z0000007z000000&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Sep 2012 14:55:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/determine-if-sde-connection-is-available/m-p/67185#M5494</guid>
      <dc:creator>AndrewChapkowski</dc:creator>
      <dc:date>2012-09-17T14:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: Determine if SDE Connection is Available</title>
      <link>https://community.esri.com/t5/python-questions/determine-if-sde-connection-is-available/m-p/67186#M5495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is the ArcSDESQLExecute command available in python run in Arc v10.0?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there an error message that would arise from this statement in python that can be trapped by a try except statement?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Sep 2012 17:36:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/determine-if-sde-connection-is-available/m-p/67186#M5495</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2012-09-17T17:36:42Z</dc:date>
    </item>
  </channel>
</rss>

