Delete data older than 90 days:
delete from [rms].[dbo].[DataRecord3] where [TimeStamp] <DATEADD(dd, -90,GETDATE());
delete from [rms].[dbo].[AlarmItems]...