Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. 5146 Error message: Invalid object name '#TmpTable'.

5146 Error message: Invalid object name '#TmpTable'.

Scheduled Pinned Locked Moved Database
databasehelploungecareer
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vkEE
    wrote on last edited by
    #1

    Hi Everyone! All of a sudden we are seeing the above error message, in one of our automated jobs. This job runs at 3am everyday. This error occurs on random days, not on a regular basis. There is not much out on this particular error. The temp table is defined in a stored procedure. Thanks!!!

    P L J 3 Replies Last reply
    0
    • V vkEE

      Hi Everyone! All of a sudden we are seeing the above error message, in one of our automated jobs. This job runs at 3am everyday. This error occurs on random days, not on a regular basis. There is not much out on this particular error. The temp table is defined in a stored procedure. Thanks!!!

      P Offline
      P Offline
      Peter Leow
      wrote on last edited by
      #2

      Not enough information to diagnose.

      1 Reply Last reply
      0
      • V vkEE

        Hi Everyone! All of a sudden we are seeing the above error message, in one of our automated jobs. This job runs at 3am everyday. This error occurs on random days, not on a regular basis. There is not much out on this particular error. The temp table is defined in a stored procedure. Thanks!!!

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        vkEE wrote:

        All of a sudden we are seeing the above error message, in one of our automated jobs.

        I've never encountered a PC that "suddenly" interprets code in a different way.

        vkEE wrote:

        This error occurs on random days, not on a regular basis.

        ..nor does it pick random days to crash. Find out what those days have in common; check if there's exceptional heavy traffic on the network during those days. Check your firewall-log. Check the schedule of your backups, automatic updates and virusscans; are they similarly "random"? Are you sure you got the correct type of temporary table? There's subtle differences between #tmpTable, ##tmpTable and @tmpTable.

        vkEE wrote:

        The temp table is defined in a stored procedure.

        Post the code of the stored procedure and you'll get more and better replies.

        Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

        V 1 Reply Last reply
        0
        • L Lost User

          vkEE wrote:

          All of a sudden we are seeing the above error message, in one of our automated jobs.

          I've never encountered a PC that "suddenly" interprets code in a different way.

          vkEE wrote:

          This error occurs on random days, not on a regular basis.

          ..nor does it pick random days to crash. Find out what those days have in common; check if there's exceptional heavy traffic on the network during those days. Check your firewall-log. Check the schedule of your backups, automatic updates and virusscans; are they similarly "random"? Are you sure you got the correct type of temporary table? There's subtle differences between #tmpTable, ##tmpTable and @tmpTable.

          vkEE wrote:

          The temp table is defined in a stored procedure.

          Post the code of the stored procedure and you'll get more and better replies.

          Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

          V Offline
          V Offline
          vkEE
          wrote on last edited by
          #4

          Thank you for your response. The job runs at 3am just for that reason, so we don't have resource issues. It has crashed 3 times the past few months, but our seniors want this matter researched since it is a new bug in their test environment. They don't want this bug to migrate to production environment. I got this error message of the log file, and it is defined with single hash, #.

          L 1 Reply Last reply
          0
          • V vkEE

            Hi Everyone! All of a sudden we are seeing the above error message, in one of our automated jobs. This job runs at 3am everyday. This error occurs on random days, not on a regular basis. There is not much out on this particular error. The temp table is defined in a stored procedure. Thanks!!!

            J Offline
            J Offline
            jschell
            wrote on last edited by
            #5

            vkEE wrote:

            The temp table is defined in a stored procedure.

            You have an execution path that is skipping the creation of the table but then attempting to use it.

            1 Reply Last reply
            0
            • V vkEE

              Thank you for your response. The job runs at 3am just for that reason, so we don't have resource issues. It has crashed 3 times the past few months, but our seniors want this matter researched since it is a new bug in their test environment. They don't want this bug to migrate to production environment. I got this error message of the log file, and it is defined with single hash, #.

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              vkEE wrote:

              our seniors want this matter researched since it is a new bug in their test environment. They don't want this bug to migrate to production environment.

              Unless you are in full control of your environment and able to debug every device-driver, some bugs will remain unsolved.

              vkEE wrote:

              It has crashed 3 times the past few months

              Do you know at what time? Anything in the event-log at that specific time? Does it run under .NET 4? If yes, you could consider making a minidump.

              vkEE wrote:

              and it is defined with single hash, #.

              I was hinting at researching the three. Whether it's the correct one will depend on the context of it's use in the stored procedure. You will have to verify the things mentioned, and again, you'd get a more usefull answer if you provide the code for the stored procedure.

              MSDN[^] states:

              There are two types of temporary tables: local and global. They differ from each other in their names, their visibility, and their availability. Local temporary tables have a single number sign (#) as the first character of their names; they are visible only to the current connection for the user, and they are deleted when the user disconnects from the instance of SQL Server. Global temporary tables have two number signs (##) as the first characters of their names; they are visible to any user after they are created, and they are deleted when all users referencing the table disconnect from the instance of SQL Server.

              ..and it becomes more confusing[^] if you are EXECUTEing dynamic SQL.

              Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups