New Table from another table inthe same DB

I need to create a temp table from another table in the same DB. I'm doing this in SQL Management Studeio 2005
intellie_exAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

vs1784Commented:
1. Generate SQL Create statement of 1st table.
2. Replace table name in the quey
3. Run it to create 2nd table
4. Run import data to transfer data from table 1 to table 2
0
intellie_exAuthor Commented:
ok sounds like it will work.. I'm new to this. little more details if possible plz.
0
Faiga DiegelSr Database EngineerCommented:
SELECT * INTO #Temptable
FROM YourOriginalTable

Is this what you need to accomplish?

0
vs1784Commented:
Run the above code

SELECT * INTO <New Table Name>
FROM <Original Table>

it will work.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Faiga DiegelSr Database EngineerCommented:
It depends how temporary table is temporary for you :)) # is per session.
vs1784's style is creating table physically (or maybe a temporary table but in a formal way of creating it)

If you need a physical table that you can see from the Table list you could do something like this:
SELECT * INTO TempTableFromOrig
FROM YourOriginalTable
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2005

From novice to tech pro — start learning today.