AnsweredAssumed Answered

Table to Excel export using python in ArcSDE

Question asked by doug_m on Jul 21, 2016
Latest reply on Jul 22, 2016 by doug_m


Hi,

I am wanting to (from Windows 10 desktop) to run a python script that exports the table from feature classes, within a feature dataset, in an ArcSDE environment. I can manually run the script in ArcMap everyday, but this will add to the tasks that I already have. I need the script to run outside of ArcGIS so I can automatically run the script with Scheduled Tasks in Windows.

I have created the connection file and can list feature datasets and classes but I cannot figure out how to use the arcpy "table to excel" tool on the feature datasets within feature classes.

 

What I have so far:

 

# Import arcpy module

import arcpy

from arcpy import env

import os

arcpy.env.workspace = "G:\Location_of_Connection.sde_file"

Utility_Pipe = "Utility_pipe_???_Unsure how to point directly at the FC in SDE"

Utility_xls = "Location of Utility Excel\Utility.xls"

 

# Process: Table To Excel

arcpy.TableToExcel_conversion(Utility_Pipe, Utility_xls, "NAME", "CODE")

 

print "done"

 

 

 

 

I using ArcMap 10.3.1 in an enterprise geodatabase on windows 10.

 

Thanks!

Outcomes