I have created a simple python script to do the following:
Everything works up until step 4 which includes a DeleteRows function call and then an Append function call. I am using DeleteRows instead of truncate due to database locks. Currently this script works perfectly fine from my local machine, but on our server machine where this script will reside for scheduling purposes I run into the error 000732: dataset does not exist or is not supported. I have run through all of the suggested workarounds/solutions and none worked. I even ran the tool in catalog on the server machine and it worked, just not in the script.
Are there any additional suggestions or could this possibly be a bug?
No the error occurs when trying to use the Delete Rows function against the SDE database table/feature class. Currently when I run the Delete Rows function against the SDE database table/feature class from my local machine the function has no problem executing. The issue occurs when attempting to run the Delete Rows function against the SDE database table/feature class from our server machine (where the script will be run from once its fully tested). I'm 99% sure its not the file path name since I was able to navigate to the SDE table/feature class using the file path the script uses (both in windows file explorer and ArcCatalog on the server machine). I even ran the Delete Rows tool in ArcCatalog (using the SDE data) and it ran fine. I then took the code snippet from the results pane and inserted it into the script and it still failed.
Yes you are correct, it is using an SDE file. I assume it's referencing the connection file properly. I have the SDE connection file located in the same folder the script runs from and the script references the file as such:
db_test = r'C:\rn_development\COVID_Testing_Sites\AZURE_HealthDepartment_gisadministrator_93.sde\HealthDepartment.DBO.CovidTestSites\HealthDepartment.DBO.IDPH_COVID_Test_Sites' arcpy.DeleteRows_management(db_test)
As for the file being the same on the local machine, yes to an extent. The exact paths differs, but the file was originally copied from local machine to the server when I was setting up the final testing on the server machine.