Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

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 by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #temp #table #sql
ADD COMMENT
Topic
Name
5+6 =