Before executing the sql secret command, I wanted to perform a health check.
I am trying to delete records with a date value of [ LoadDt ] older than 3 days, and my code is:
delete IntraDayStats where DATEDIFF(dd, LoadDt, dateadd(d,-3, getdate()) ) >= 3
I want to assign this as a sql job so that the IntraDayStats table IntraDayStats a 3 day history. Work will be performed at night.
sql-delete datediff sql-server-2005
kacalapy
source share