Temporary Tables – Local vs Global

Hi all,

I just wanted to share a link that has a great explanation on the difference between a local temp table, and a global one.

And if you can’t be bothered checking it out, I’ll summarize..

A local temp table (#table_name), exists only for the duration of a user session or the procedure that created the temporary table. When the user logs off or when the procedure that created the table completes, the local temp table is disposed.

A global temporary table (##table_name), also exists for the duration of a user session or the procedure that created the table. However, multiple users (in other words, all other database users) can access a global temporary table.

I hope it helps!

Subscribe

0 comments