4
Answers

HW TO COPY THE DATA OF ONE TABLE TO ANOTHER TABLE IN SQL SER

Photo of vivek upadhyay

vivek upadhyay

11y
1.7k
1
QUERY WITH DETAILS EXAMPLE

Answers (4)

1
Photo of Palle Technologies
NA 289 38.5k 11y
create table t1 ( c1 int ,c2 varchar(20))
insert into t1 values (1,'lok')
insert into t1 values (2,'rajeev')
--now copy the above tables data into another table.
case1: when destination table is not existing use below query
select * into newtablename from t1
case2: assume you have another table with same structure as t1 table and assume its name as t2. then use below query
insert into t2 select * from t1

hope this helps.
0
Photo of JAYRAM
NA 272 221.3k 11y
insert into table2
select * from table1
0
Photo of Jignesh Trivedi
NA 62.3k 46.3m 11y
0
Photo of Vithal Wadje
11 55.4k 51.1m 11y
yes correct Palle tech