How to create a new table from the existing table but the table created with the structure of existing table no data should be taken from existing table
How to create a new table from the existing table but the table created with the structure of existing table no data should be taken from existing table
its so simple
hope this solves your problemCode:create table newtable as select * from oldtable where 1=2;
instead of using 1=2 in the SQL statment ,you can use any other expression which logically evalutes to FALSE.
CREATE TABLE tablename
AS
SELECT * FROM tablename
WHERE ( a cond that is returns 0 rows)
If it is SQL Server Then Use INTO functions
SELECT TOP 0 * INTO new_table_name FROM old_table_name