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 to create a scrollable cursor with the scroll option?
What is @@rowcount in sql?
How many levels of sp nesting is possible?
What does nvl stand for?
Which are ddl commands?
Explain what are the events recorded in a transaction log?
create index myindex on mytable(mycolumn) what type of index will get created after executing the above statement? : Sql server database administration
How do clustered indexes store data?
Explain syntax for viewing trigger?
How to connect sql server management studio express to sql server 2005 express?
What is schemabinding a view?
Tell me what is log shipping?
How to create a user name in a database?
how to control the amount of free space in your index pages? : Sql server database administration
Explain syntax for viewing, dropping and disabling triggers?