How can I create a table from another table without copying any values from the old table?
Answer Posted / amit kumar sharma
Select * into newTable From oldTable where 1=2
The where condition 1=2 will never get true, so only the
column of table will appear and get copied to newTable.
If we remove the where condition table with data will copy
to newtable.
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
Beginning with sql server version 7 0, a new enhanced data type nchar was added what type of data is supported with this data type?
Why is there a performance difference between two similar queries where one uses union and the other uses union all?
Difference between Inner vs outer joins?
What is difference between drop truncate and delete?
How to create indexed view?
What is sql server 2000 work load governor?
Is sql server implemented as a service or an application? : Sql server database administration
What is the difference between inner join and equi join?
What is difference between createstatement and preparedstatement?
What is the fillfactor concept in indexes?
What is nonclustered index with included columns ?
Difference between connected and disconnected database in .net with sql server?
How do I manually uninstall an instance of sql server 2016?
How to sort the query output with order by clauses in ms sql server?
What is the difference between coalesce() & isnull()?