Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 update one table from select on another (same layo

Author  Topic 

olibara
Yak Posting Veteran

94 Posts

Posted - 2011-05-09 : 10:34:51
Hello

I have two tables T1 T2 with the same schema (T2 is a back-up of T1)
I want to update T2 with a select * on T1 before to delete those records in T1

Is it possible ?
Thanks for your help

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2011-05-09 : 10:41:31
insert into t2 (col_list)
select col_list from t1 where....

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

olibara
Yak Posting Veteran

94 Posts

Posted - 2011-05-09 : 10:53:02
Thank you madhivanan
But is it possible to do it whithout the ColList (with a '*')
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2011-05-09 : 11:36:51
quote:
Originally posted by olibara

Thank you madhivanan
But is it possible to do it whithout the ColList (with a '*')


You can use it as long as there are same number of columns with same datatype

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -