• All SQL Folks...

    The original script has MAJOR error....

    --In PART2 --- where it runs to update the growth table...it tries to convert the DATE to CHAR...and then compares with GetDATE() -- which is not correct.

    --- I have corrected the script...BELOW>..replace the script code with Following for your EXISTS condition....This works good for SQL 2000....Change your EXISTS condition accordingly for 2005 script too..

    -PART 2 -- CORRECTED EXISTS Section below...Replace on original script.;-)

    ...

    ...

    If Exists (Select Distinct DBName from #TempDBSize2

    where DBName in (Select Distinct DBName from DBGrowthRate))

    and GetDate() > (Select Distinct Max(MetricDate) from DBGrowthRate)