<?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: python script not running as a SQL Server scheduled job in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/python-script-not-running-as-a-sql-server/m-p/231367#M7999</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here are the instructions to run a Python script as a scheduled task in SQL Server:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Open SQL Server Management Studio&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. Select SQL Server Agent&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. Right-click on "Jobs" and select "New Job"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4. On the "Steps" page, select "New" (At the bottom of the screen)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;5. Select "Operating System (CmdExec)" for the "Type"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-- Sample Python script (C:\Python26\HELLO_931.py)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;print 'HELLO'&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-- Type in the following information in the "Command" window&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;cd C:\Python26&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;HELLO_931.py&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Dec 2012 22:55:22 GMT</pubDate>
    <dc:creator>RashanWalker</dc:creator>
    <dc:date>2012-12-13T22:55:22Z</dc:date>
    <item>
      <title>python script not running as a SQL Server scheduled job</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-script-not-running-as-a-sql-server/m-p/231366#M7998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Python 2.7&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ArcGIS 10.1 (sp1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ArcSDE 10.1 (sp1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SQL Server 2008 R2 Standard (sp2)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Windows Server 2008 R2 Standard (sp1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Run a batch file, which calls a python script, as SQL Server scheduled job, if the python script includes "import arcpy" statement, the script will fail without leaving any error message. The script works fine without the "import arcpy" statement. Tried samething as a system scheduled task, the results are same. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;While running the batch file from command line, it works fine with or without the "import arcpy" statement.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyone ever experienced same thing, and have a clue?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advanced!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Dec 2012 18:02:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-script-not-running-as-a-sql-server/m-p/231366#M7998</guid>
      <dc:creator>RobertHu</dc:creator>
      <dc:date>2012-12-12T18:02:11Z</dc:date>
    </item>
    <item>
      <title>Re: python script not running as a SQL Server scheduled job</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-script-not-running-as-a-sql-server/m-p/231367#M7999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here are the instructions to run a Python script as a scheduled task in SQL Server:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Open SQL Server Management Studio&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. Select SQL Server Agent&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. Right-click on "Jobs" and select "New Job"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4. On the "Steps" page, select "New" (At the bottom of the screen)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;5. Select "Operating System (CmdExec)" for the "Type"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-- Sample Python script (C:\Python26\HELLO_931.py)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;print 'HELLO'&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-- Type in the following information in the "Command" window&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;cd C:\Python26&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;HELLO_931.py&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Dec 2012 22:55:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-script-not-running-as-a-sql-server/m-p/231367#M7999</guid>
      <dc:creator>RashanWalker</dc:creator>
      <dc:date>2012-12-13T22:55:22Z</dc:date>
    </item>
  </channel>
</rss>

