I update a point layer on a SQL server enterprise geodatabase by scheduling a Truncate and Append job in ArcPro every night. The scheduled jobs are python scripts are Windows Task Scheduled jobs where the scripts are located in C:\Users\myuser\AppData\Local\ESRI\ArcGISPro\Geoprocessing\ScheduledTools.
This method has worked well until the point layer was connected to a published map in the WebApp. Now, every night, the Truncate tool runs, emptying the layer, but the Append returns an 0x1 error in Task Scheduler.
I'm having a hard time tracing the error, as the tool "runs" but doesn't actually append any records.
I'd also like to know if there's a more Esri approved method for pipelining data like this, updating from local geodatabase to Enterprise to ArcOnline/Web?
Is this a MapService? I had similar issues trying to append to SDE dataset(s) that are utilized in services due to the schema locking.
At first, I would run script to stop the required services, then do my append, then restart the service.
For most of them now, I have found that in the service properties (of mapservice), you can disable the schema locking and I can truncate/append at will with no errors.
R_
Thank you! I'll try this out. It's curious that Truncate runs fine despite the schema locks. Did you see the same issue?