I have problem defining arcpy.env.workspace in a separate module when publishing the script as a Geoprocessing Service on arcgis server.
my main tool script:
from myModule import myTool
workspace = "Database Connections\\GEOP011@demma18.sde"
tableName = "DEMMA18.MyTable"
def execute(workspace, tableName)
arcpy.env.workspace = workspace
with arcpy.da.SearchCursor(tableName, ["OBJECTID"]) as cursor:
for row in cursor:
When published to the server, this script will return error : cannot open DEMMA18.MyTable
However, if I put the same code in a single .py file it runs on the server without error. Any Idea what is going wrong?