Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2002
    Posts
    2

    Unanswered: Accessing local temporary tables

    I've been able to get the local temporary table name from sysobjects, but I still can't select from it.

    for example, the following select statement won't work
    select * from #temptable_____00015
    It says invalid object name.

    I've even stored the temp table name in a variable and tryed to execute dynamic sql to get to it--no luck.

    I need this technique to handle two support situations: A user freezes during data entry to a temp table, I want to capture the data before they reboot, so they don't have to reenter.

    Temp tables are used among several stored procedures and then crunched into other tables. I'm getting incorrect results and want to see the raw data in the temp tables to assist me in figuring out what's going on.

  2. #2
    Join Date
    Feb 2002
    Posts
    2,232
    Local temporary tables are connection based in scope so only the connection that created it may use it. Depending on your use you may need to use global temporary tables.

  3. #3
    Join Date
    Sep 2002
    Posts
    2
    Originally posted by rnealejr
    Local temporary tables are connection based in scope so only the connection that created it may use it. Depending on your use you may need to use global temporary tables.
    They exist on the hard drive. Maybe if I changed the status value in sysobjects, I could select from them?

  4. #4
    Join Date
    Feb 2002
    Posts
    2,232
    Please define in detail the issue you are trying to solve.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •