June 5, 2008 at 2:47 pm
I'd like to remove DTS Packages not used in over 1 year. I run the following query but only receive 3 results, and manually looking at the packages and their logs, I can see there are more.
SELECT sysdtspackages.name, MAX(sysdtspackagelog.logdate) AS LogDate
FROM sysdtspackages INNER JOIN
sysdtspackagelog ON sysdtspackages.id = sysdtspackagelog.id
GROUP BY sysdtspackages.name
HAVING (MAX(sysdtspackagelog.logdate) < GETDATE() - 365)
Any help appreciated!
¤ §unshine ¤
June 5, 2008 at 2:57 pm
I get this error..
Line 5: Incorrect syntax near ')'.
¤ §unshine ¤
June 5, 2008 at 4:50 pm
I didn't receive any such error message when I ran this code on SQL 2000 box.
Manu
June 6, 2008 at 1:56 am
my fault, i added an incorrect post about using dateadd function which i deleted. unfortunately sunshine has already tried it, hence spurious post about missing ')'
please ignore that post.
---------------------------------------------------------------------
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply