I have an ArcSDE database on SQL Server 2016 and I want to delete features from a condition.
Each night I want to delete thousands of points older than 30 days from now.
My points layer has a datetime2 field (created_date).
I thought using the SQLExecutor to do this and run this script.
DELETE FROM GPSData
WHERE [created_date] < DATEADD(DAY, -30, GETDATE())
Unfortunatly it doesn't work and I don't understand why. The log doesn't say much :
Microsoft SQL Server Spatial Reader: Query failed, possibly due to a malformed statement. ÂÂ Query Text `DELETE FROM GPSData
WHERE [created_date] < DATEADD(DAY, -30, GETDATE())'. Provider error `(-2147217871) Query timeout expired'
If I replace DELETE by SELECT *, it works though.
Is there any SQL beast here who would know if it's my query or FME the problem? I don't have access to this SQL Server, so I can't test my query over there.
For sure I could create a procedure straightly in SQL Server, but my FME script is doing a FGDB backup of those points before deleting them.