Error in Stored procedure

  • A stored procdure with the following line

    SELECT * FROM TempTable

    at the end is getting parsed and compiled. But the Database doesnot contain any object named 'TempTable'. An error(invalid object name) is being thrown at this line when the sp is excecuted.

    Any idea where i am going wrong.

  • You say the "...Database doesnot contain any object named 'TempTable'". So why are you trying to select from a table that doesn't exist?

    A stored procedure will parse and compile when something doesn't exist, because it expects that the missing object WILL exist when the sp is executed. This allows you to write sp's that will run against a temporary object or one that is only created prior to the execution of the sp.

    -Bill

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

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