Create a new sql table from a temp table when the fields in the temp table are unknown.

I have a temp table (#<temptablename>) in my code which contains about 50 fields. How can I create a permanent sql table from this temp table?
Lenny GrayAsked:
Who is Participating?
 
Aneesh RetnakaranConnect With a Mentor Database AdministratorCommented:
SELECT * into permanentTableName
FROM #tempTableName

this will create the table and populate the data
0
 
Jim HornConnect With a Mentor Microsoft SQL Server Developer, Architect, and AuthorCommented:
SELECT * INTO NewPhysicalTableName FROM #temptable
0
 
Lenny GrayAuthor Commented:
Thanks!
0
All Courses

From novice to tech pro — start learning today.