I would like to delete nodes based on the following SWQL select statement:
SELECT DISTINCT NodeID FROM Orion.Nodes WHERE Status = 9 AND UnManageFrom < ADDYEAR(-1,GETDATE())
(3948 nodes)
I could do this with SQL Management Studio but am afraid this would break table relationships. Whereas, SWQL Studio enforces them.
The equivalent SQL would be as follows:
DELETE
FROM [NetWolves_Orion_NPM].[dbo].[NodesData]
WHERE [NodesData].[Status] = 9
AND CONVERT(date,[NetWolves_Orion_NPM].[dbo].[NodesData].[UnManageFrom] ) < CONVERT(date,DATEADD(year,-1,GETDATE()))
Please help. Thanks in advance.