Reputation: 4971
how to dynamically create a table with same columns as that of previous table. in sql
Upvotes: 1
Views: 512
Reputation: 439
I believe that both of the above answers will work, but since you don't need the data and you just need the format, I would do the following:
select * into new_table from table
TRUNCATE new_table; -- I'm sure you know this, but just in case someone is new and doesn't, truncate leaves the table structure and removes all of the data.
Upvotes: 0