I had an interview in which the interviewer asked me how can you access the temp table in a stored procedure that is created in another stored procedure, and this procedure does not cancel the temp table?
I told him that you can access the temp table in one session. He said, but when you do this:
Select * from
This will give an error because #table is not created in the current SP. I said that you can access the temp table in one session, and if both SPs are in the same session, you can access this temporary table. I have not tried this, but there will be access to it. He said yes, you can access it, but how? Try it at home.
I know that a table created with #table is a temporary table. It is available in only one session. I am trying to access the temp table created by other sp in one session, but I cannot access it. Is there any way to do this?
source
share