debugging stored procedure temp table in Query Analyzer

  • I build a couple of temp tables in my stored procedure. When I am debuggin, I cannot figure out how to see the contents of the temp table. This is probably easy to do, it just escapes me how to do it...

    Thank you for any help you can provide.

  • Why can't you run the parts of the procedure up to the point the temp table is created and populated, then do a SELECT * from the temp table?

    Greg
    _________________________________________________________________________________________________
    The glass is at one half capacity: nothing more, nothing less.

  • I tried that but it throws a 'Invalid object name '#DistinctEmail'.' with #DistinctEmail being the temp table.

  • Can't believe the rubbish I wrote first time. You need to put the SELECT inside the stored procedure. A temporary table is only visible to its creator and only exists for as long as the creator exists. So a temporary table created by a stored procedure will disappear when the stored procedure terminates.

  • Cool...I love you. Invaluable peice of information.

  • Forgot to mention that your suggestion helped.

  • Glad to be of assistance.

    Mike

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply