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 delete all rows with truncate table statement in ms sql server?
What is merge?
Is it possible to call a stored procedure within a stored procedure?
What the class forname () does?
What is the difference between osql and query analyzer?
Explain the relational database management system (rdbms)?
What is the difference between local and global temporary tables?
Do you know the isolation level that sql server support?
How to fetch the next row from a cursor with a "fetch" statement?
after migrating the dts packg to ssis by using migrtn wizrd in 2005. iam not able to open ssis pack and getting error. what r those errors? how to resolve?
Differentiate between ms sql server reporting services vs crystal reports?
Is it possible to replicate data from sql server to oracle? : sql server replication
Can a table be created inside a trigger?
What is difference between equi join and inner join?
Can we install sql server 2016 on windows 7?