How can I create a table from another table without copying any values from the old table?
Answer Posted / mohammadali.info
CREATE TABLE new_table
AS (SELECT * FROM old_table WHERE 1=2);
For example:
CREATE TABLE suppliers
AS (SELECT * FROM companies WHERE 1=2);
This would create a new table called suppliers that included all columns from the companies table, but no data from the companies table.
| Is This Answer Correct ? | 7 Yes | 3 No |
Post New Answer View All Answers
what is bit datatype? : Sql server database administration
What is difference between sql and sql server?
What is the Main Difference between ACCESS and SQL SERVER?
You want to generate a report that is formatted as a chart. Can you use the report wizard to create such a report?
What does normalization do to data?
How display code or Text of Stored Procedure using Sql query in Sql Server ?
What is the purpose of floor function?
What is query cost in sql server?
Explain trigger and trigger types?
State the difference between union and union all?
What are various aggregate functions that are available?
What are various ways to enhance the ssrs report?
What is the full meaning of dml?
What is store procedure? How do they work? When do you use?
Can you please explain the difference between primary keys and foreign keys?