October 30, 2009 at 7:58 am
i tried the below query to delete the records from sysjob history table.but i got the error as
delete from sysjobhistory where run_date <= dateadd(d, -30, getdate())
Server: Msg 8115, Level 16, State 2, Line 1
Arithmetic overflow error converting expression to data type datetime.
The statement has been terminated.
pls help me to sort it out
October 30, 2009 at 8:11 am
That's probably because run_date is actually held as an integer in sysjobhistory, not a datetime.
Have a look at the advice you've been given on some of the other threads you started regarding job history, and use the in-built methods of managing this, rather than trying to do it yourself.
October 30, 2009 at 8:15 am
Ian Scarlett (10/30/2009)
That's probably because run_date is actually held as an integer in sysjobhistory, not a datetime.Have a look at the advice you've been given on some of the other threads you started regarding job history, and use the in-built methods of managing this, rather than trying to do it yourself.
+1
Not usually recommended to try direct manipulation of system table data. There may be other tables involved in storing that information that you are not considering.
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply