Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COPY table? 1

Status
Not open for further replies.

webmigit

Programmer
Aug 3, 2001
2,027
US
Is there a way that I can copy a table so that all of its contents are copied to another table..

I need to run through about the 300 sets of tables, all in the same database, and delete 299 sets and then recopy the remaining one with contents, to other the other 299..

Tony

ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
I'm not even going to get into why would you have 300 instances of the same data in the same db.....

But Select * into newtable from oldtable is one way

another is to create the table ahead of time and do an insert into with a select as it's source..

Look up "Select Into" in BOL and "insert" -tsql reference


Rob
 
Thanks

And yes it bothers me too..

I know.. centralize the data but I came onto a live site and there's too much to centralize in a day or two...

So for now I have to work within the given boundaries

ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top