I have been currently running this query for the past 5 days and it still hasn't completed.
I wanted to see if someone could look at my query and let me know if there is a way to speed it up.
A little background (this is a query to purge threat event 1095 from our SQL database for our ePO server. The events are clogging up the database currently these events account for 165GB of the database. I have been running the query to check away at blocks of the data. The current query is purging data between '2016/03/20' and '2016/05/20. I need to keep 120 days of data for security reasons).
SET ROWCOUNT 10000
DELETE FROM epoEvents
WHERE (([EPOEvents].[ThreatEventID] = '1095')
AND ([EPOEvents].[ReceivedUTC] BETWEEN '2016/03/20' AND '2016/05/20'))
WHILE @@rowcount > 0
BEGIN
DELETE FROM epoEvents
WHERE (([EPOEvents].[ThreatEventID] = '1095')
AND ([EPOEvents].[ReceivedUTC] BETWEEN '2016/03/20' AND '2016/05/20'))
END
SET ROWCOUNT 0
GO
Any help is appreciated.
Thank you