create temp table in sql
-- CREATE TEMP TABLE Create Table #MyTempTable ( EmployeeID int );
Source: stackoverflow.com
declare temp table in sql
DECLARE @TempTable AS TABLE (Id INT); -- add column that you need with datatype.
temp table sql
-- create Local temporary table i.e single hash(#) CREATE TABLE #TempTable ( Column1 datatype, column2 datatype……) INSERT INTO #TempTable (Column1, column2……) VALUES ('value 1', 'value 2') -- 2nd method (Select Into) SELECT * INTO #TempTable FROM SampleTable WHERE... -- create Global temporary table i.e double hash(##) CREATE TABLE ##tablename ( Column1 datatype, column2 datatype……)
Source: stackoverflow.com