Our own Garth Jones has a great blog full of regularly posted SQL and WQL scripts for grabbing information from the SMS database. You should watch this blog, or just grab the RSS feed…
Blog URL: http://smsug.ca/blogs/garth_jones/default.aspx
RSS Feed: http://smsug.ca/blogs/garth_jones/rss.aspx