Link to home
Start Free TrialLog in
Avatar of intellie_ex
intellie_exFlag for Canada

asked on

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
Avatar of vs1784
vs1784

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
Avatar of intellie_ex

ASKER

ok sounds like it will work.. I'm new to this. little more details if possible plz.
SELECT * INTO #Temptable
FROM YourOriginalTable

Is this what you need to accomplish?

ASKER CERTIFIED SOLUTION
Avatar of vs1784
vs1784

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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