of course if you let me know what you what to achieve I can provide scripts.
I dont purge via SQL, I just flag as baseline if I want to keep them, then I run the NCM purge job.
--select-
select * from ConfigArchive
where ConfigType = 'Running' -- or use 'Startup'
AND DownloadTime < GETDATE()-30 -- i.e. i.e. downloaded prior to 30 days ago
--update--
update ConfigArchive
set Baseline = 1
where ConfigType = 'Running' -- or use 'Startup'
AND DownloadTime < GETDATE()-30 -- i.e. downloaded prior to 30 days ago
I actually now keep every startup and running config taken on the 1st of every month, then purge all other configs over 3 months old that arnt marked as baseline. Just for our audit purposes.
select * from ConfigArchive
where (DATEPART(day,DownloadTime)=1) --and Baseline <> 1
update ConfigArchive
set Baseline = 1
where (DATEPART(day,DownloadTime)=1) and Baseline <> 1
I dont really use the baseline feature so for me this is perfect until NCM is developed to allow for better purge and archiving rules.