— Create TEMP Table Local
— Disappears when windows of query is closed.
CREATE TABLE #tmp_table (
id INT,
NAME VARCHAR(20) )
SELECT 1 AS ID,
‘John’ AS NAME
NAME VARCHAR(20) )
SELECT 1 AS ID,
‘John’ AS NAME
— Create And Insert Into Temp Table
INSERT INTO #tmp_table
SELECT *
FROM #tmp_table
— Temp Table Global
CREATE TABLE ##tmp_global_table -- Create TEMP Table
(
id INT,
NAME VARCHAR(20)
)
INSERT INTO ##tmp_global_table
VALUES (1,'One')
SELECT *
FROM ##tmp_global_table