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
DECLARE @sql varchar(max)
IF object_id('tempdb.dbo.##MyTemp') Is Not NullDROP TABLE ##MyTemp
SET @sql =
'SELECT * INTO ##MyTemp FROM (select name from sys.all_objects ) as tbl'
Exec (@sql)
go
SELECT * FROM ##MyTemp