You are currently browsing comments. If you would like to return to the full story, you can read the full entry here: “SQL Server SPID – What is it?”.
You are currently browsing comments. If you would like to return to the full story, you can read the full entry here: “SQL Server SPID – What is it?”.
Going by the line “Temp tables that are created within a SPID are accessible from any proceeding execution in that SPID”,
1. Create a stored procedure that creates a #temp table.
2. Open a new Query Window in SSMS.
3. Execute the stored procedure and then from outside the stored procedure try to excute the following statement “Select * From #temp” it will not get executed.
My question is when the @@SPID is same why the temp table created in a stored procedure is not accessible outside the stored procedure.
The New Query window is a separate connection and therefore spid.
New query window was opened to execute procedure and run select statment. Both in the same query window. Both on same spid.
[...] is you need to kill the sql session which is locking the database. Firstly you need to query which spid is locking the [...]
[...] is you need to kill the sql session which is locking the database. Firstly you need to query which spid which is locking the [...]
Have problems with spid -2 in sqlserver 2005. How do I kill these processes?
Thanks a lot for the accurate information.