I create a Python Script as Show below to print the list of Datasets in arcpy.AddMessage() this script run successfully for (*.gdb, *.sde) but when publish this script as Geoprocessing Service it work successfully for (*.gdb) only and return empty list for (*.sde).
Note: The two workspaces I used as “E:\WSTest.gdb” and “E:\WSTest.sde” where SDE is for SQL Server Express 2008R2
WS_in is string for the path of Workspace
import arcpy WS_in = arcpy.GetParameterAsText(0) arcpy.env.workspace = WS_in arcpy.AddMessage(arcpy.env.workspace) lst = arcpy.ListDatasets() arcpy.AddMessage(lst) for i in lst: arcpy.AddMessage(i)
Solved! Go to Solution.
you might need to register the database connection on the server.
Here's a link in case you are unfamiliar with this setup.
you might need to register the database connection on the server.
Here's a link in case you are unfamiliar with this setup.
Thank you it work