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 the parse query button used for?
What are the disadvantages of merge replication?
How to delete exactly duplicate records from a table?
How to find the service pack installed? : sql server database administration
What are the differences between substr and charindex in sql server.
Can you always create a cache of a report?
How to create a simple stored procedure in ms sql server?
What are the types of containers in ssis?
when you create a database how is it stored? : Sql server database administration
what are the new features in SSRS?
How do we upgrade from SQL Server 6.5 to 7.0 and 7.0 to 2000?
What command do we use to rename a database?
What is the Control Flow in SSIS
What is merge join?
Explain in details security in SQL azure?