Solved

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

Posted on 2013-06-24
3
363 Views
Last Modified: 2013-06-24
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?
0
Comment
Question by:Lenny Gray
3 Comments
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 250 total points
ID: 39272989
SELECT * into permanentTableName
FROM #tempTableName

this will create the table and populate the data
0
 
LVL 65

Assisted Solution

by:Jim Horn
Jim Horn earned 250 total points
ID: 39272991
SELECT * INTO NewPhysicalTableName FROM #temptable
0
 

Author Closing Comment

by:Lenny Gray
ID: 39273237
Thanks!
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question