
[dbo].[ExpireExecutionLogEntries]
CREATE PROCEDURE [dbo].[ExpireExecutionLogEntries]
AS
if exists (select * from ConfigurationInfo where [Name] = 'ExecutionLogDaysKept' and CAST(CAST(Value as nvarchar) as integer) = -1)
begin
return
end
delete from ExecutionLog
where DateDiff(day, TimeStart, getdate()) >= (select CAST(CAST(Value as nvarchar) as integer) from ConfigurationInfo where [Name] = 'ExecutionLogDaysKept')
GO
GRANT EXECUTE ON [dbo].[ExpireExecutionLogEntries] TO [RSExecRole]
GO