Say table1 and table2 already exist, is there any difference between these queries
query1 :-
select * into table1 from table2 where 1=1
query2: –
insert into table1 select * from table2
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
select * into table1 from table2 where 1=1creates table1 and inserts the values of table2 in them. So, if the table is already created that statement would give an error.The
insert into table1 select * from table2only inserts the values of table2 in table1.