I am storing the result set from a Select statement using the Rank () into a temporary table in 2005. This works fine when I run the statements as a script, however the exact same code in a stored procedure does not work. The result set is not stored in a temporary table. I tried storing the results in a physical table but that did not work either. Has anyone else experienced this yet

Using Rank() inside a stored procedure
TLJ
Your problem may be caused by the fact that a temporary table created inside a stored procedure does not persist after the procedure has exited. If you want the results to be persisted, use a table variable as an output parameter, or have the procedure perform the select so that you can view the results before it returns (or though in this case they will not persist). I am not sure why you cannot store the results in a real table. Can you post the code
MarkAok
Fulankazu
Thanks for the reply. I will post my code soon. I understand the scope of the temp table. I am trying to access the temp table within the procedure itself programatically and do not require the result set outside of the procedure. I have not worked with Rank() before. I have to run out right now but will post the snippet soon. Thanks very much for your interest and assistance.