patternMinor
Are temp tables automatically created when referencing to them?
Viewed 0 times
tablesarecreatedtempautomaticallyreferencingwhenthem
Problem
I came across the following script and I am trying to understand it.
The
My somewhat general question is:
Will the above create the temp table automatically and why? Is this only for T-SQL or applies generally?
select columnA, columnB, columnC
into #tmpTable
from tableAThe
#tmpTable is referenced after that query, but not before it. There is not a declaration for #tmpTable anywhere in the sql script. My somewhat general question is:
Will the above create the temp table automatically and why? Is this only for T-SQL or applies generally?
Solution
It's not only about Temporary table it's about the
But this statement does not inherit any
INTO Statement in Sql Server. The INTO statement creates a table in the Database and this table is equal to same table we create with Create Table statement. But this statement does not inherit any
constraints.Context
StackExchange Database Administrators Q#124304, answer score: 7
Revisions (0)
No revisions yet.