Alex Rivera | Logout

SQL Server copy all rows from one table into another i.e duplicate table

Asked 2010-04-22T13:59:56.093
36

I want to keep a table as history and replace it with an empty one. How can I do this through Management Studio?

Edit
Report

2 Answers

32

Don't have sql server around to test but I think it's just:

insert into newtable select * from oldtable;
answered 2010-04-22T14:02:17.093
22
select * into x_history from your_table_here;
truncate table your_table_here;
answered 2010-04-22T14:04:48.493

Your Answer