Creating A Temp Table In SQL

CREATE TABLE #TempTable

( 

  SomeColumn1 INT,

  SomeColumn2 VARCHAR(50)

)

INSERT INTO #TempTable

SELECT SomeColumn3, SomeColumn4 FROM SomeTable WHERE SomeColumn5 = @SomeParameter

DROP TABLE #TempTable

Advertisements