i have 4 tables.. T1, T2, T3, T4..
these tables have the same structure and they store the
information entered in different years..
T1 stored 2002, T2 stored 2003, T3 stored 2004 and T4 stored
2005..

i want to copy contents in T1 to T2, T2 to T3, T3 to T4 and
T4 to T1..
how do i do that? Temp tables cannot be used..

Answer Posted / madhu sudhan g

Hiii

DELETE T1
OUTPUT DELETED.COLUMN1,DELETED.COLUMN2...
INTO T2
DELETE T2
OUTPUT DELETED.COLUMN1,DELETED.COLUMN2...
INTO T3
DELETE T3
OUTPUT DELETED.COLUMN1,DELETED.COLUMN2...
INTO T4

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are logical database components? : SQL Server Architecture

481


Explain magic tables in sql server?

547


Why we use the openxml clause?

537


What are some examples of schemas?

533


What are the steps you should follow to start sql server in single-user mode?

482






What is subreport?

96


What is query parameter in ssrs?

118


Write a sql query to get zero records from a table having n number of records?

705


What is the purpose of sql profiler in sql server? : sql server database administration

623


How to list all login names on the ms sql server?

533


What is the primary use of the model database?

619


When is the use of update_statistics command?

553


How to use linked server?

591


What is the purpose of the tempdb database?

571


what is the difference between delete table and truncate table commands? : Sql server database administration

519