I am big store procedure which create a temp table during execution and then does select into and insert in this temp table. I am trying to do these steps in another store procedure which is called from the first one. But when I am trying to save second store procedure I am getting the error - "#temp_table is not exists" even thow I run create temp_table statement before save. Any Ideas why I can't save it?
Usually, temp tables are named with a leading #, like #temp_table. These tables are created in tempdb, and automatically dropped after the stored procedure has done it's job. Give the table a name without leading #, and make sure that you are working in the same database where the table is created, or set a reference to the database like: select * from MyBase..temp_table