I’m reading a book about SQL.
In that book, I saw strange query below:
SELECT * into mycustomer from customer WHERE 1=2
In this query, what is “WHERE 1=2” ?
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.
Usually used to copy structure of one table to into another, as in your case.
This code creates an identical structure of table
Customerin your new tableMyCustomer.Note that in SQL Server, the constraints are not copied; so probably you would need to recreate the constraints.