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
How many types of the database links?
What does Master database contains?
Does a sql server 2005 select statement require a from?
Explain the difference between delete,drop and truncate in SQL Server?
What do you mean by an execution plan? Why is it used?
Differentiate between sql temp table vs table variable?
what is isolation level at dead lock?
List out some of the requirements to set up a sql server failover cluster?
What do you mean by a dependent functionality in a build?
How many database files are there in sql server 2000?what are they?
What is bookmark link in ssrs?
Are resultset updatable?
Tell me the phases a transaction has to undergo?
What does this statement do @@rowcount?
How to enter binary string literals in ms sql server?