Local temporary tables are visible only to their creators during the same connection to an instance of SQL Server as when the tables were first created or referenced. Local temporary tables are deleted after the user disconnects from the instance of SQL Server.
Global temporary tables are visible to any user and any connection after they are created, and are deleted when all users that are referencing the table disconnect from the instance of SQL Server.
Some More Definitions from StackOverFlow:
DECLARE @t TABLE
) are visible only to the theconnection that creates it, are stored in RAM, and are deleted when
the batch or stored procedure ends.
CREATE TABLE #t
) are visible only to the connection that creates it, and are deleted when the connection is closed.CREATE TABLE ##t
) are visible to everyone, and are deleted when the connection that created it is closed.USE tempdb CREATE TABLE t
) are visible to everyone, and are deleted when the server is restarted.
No comments:
Post a Comment