[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 135
  • Last Modified:

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
0
intellie_ex
Asked:
intellie_ex
  • 2
  • 2
1 Solution
 
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
 
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

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now