• Gaby,

    Good stuff, thanks.

    I like to be really description and accurate with my column titles and I kept changing my mind what to call the date column.

    Finally settled on LatestDate since the script is DESC (this obviously could easily be changed to ASC & the column name to EarliestDate)

    That final order by is very optional - ordering by the TableName is very useful as well.

    Can anybody else out there solve:

    a) the 256 table limit problem?

    b) the final union all statement you need to delete issue?

    c) if yes to a&b then make it an EXEC Table Function (with suggestions for possible parameters?)

    ...and maybe d) an extra column, so you get EarliestDate as well as the LastestDate - That would be 😎

    This might all seem a bit pointless 😉 if you work with a database with hardly any dates, but trust me it's very useful if you do have a lot of dates to lookup (in my case it's due to a badly designed database I inherited & report from)

    - Gav B.