As the system table names had been changed in SQL 2008, an earlier contribution unfortunately will return with an error message on SQL 2008, 2008 R2, and 2012 - so a slightly modified script is needed to get the same information.
This script is tested on these platforms by the author. It is likely to work on other platforms as well. If you try it and find that it works on another platform, please add a note to the script discussion to let others know.