Ensure that reportID, roleID are indexed on table #tbl.
Follow Lynn's advice, because there's almost certainly a faster way of doing this - providing sufficient detail will enable folks to figure it out for you.
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]