I wouldn�t use a procedure here, just some good old fashioned SQL will work better.
Jeff
Attachments
Library
Quick Reference
Archives
Sample Index
2008 Indexes