Does SQL server automatically purge these out after a given length of inactivity or do I need to worry about purging them automatically? If so, how do I query for a list of tables to purge?
Does SQL server automatically purge these out after a given length of inactivity or
Share
Local temporary tables are destroyed when you close your connection to SQL Server. There is no need to manually purge them under normal circumstances. If you maintain a persistent connection, or connection pooling, you may want to get in the habit of dropping temporary tables immediately after use.
Global temporary tables, on the other hand, since they are visible to all users in a given database, are destroyed along with the last connection which references them.