How can I create a table from another table without copying
any values from the old table?

Answer Posted / ram

In oracle

Create table newtablename as select * from oldtablename
where 1=2
(any false condition if condition true it copies data from
table it applicable for both oracle & sqlserver)

In Sql server

select * into newtablename from oldtablename where 1=2

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what are the differences between public, private, protected, static, transient, final and volatile? : Sql dba

546


What are the conditions an underlying table must satisfy before a cursor can be used by a positioned update or delete statement? : Transact sql

525


What is pl sql variable?

500


How to add, remove, modify users using sql?

551


How is a process of pl/sql compiled?

594






How do you get column names only for a table (sql server)?

659


Does sql view stored data?

528


What is scalar function?

560


Why having clause is used in sql?

530


What is query optimization in sql?

542


what is 'trigger' in sql? : Sql dba

548


how to get a list of indexes of an existing table? : Sql dba

506


What are the parts of a sql statement?

546


Can we commit inside a trigger?

541


Is sql a programming?

537