Convert Volatile Table to Permanent Table

Database
Fan

Convert Volatile Table to Permanent Table

Can someone show me the code that you would use to convert a volatile table to a permanent one?
3 REPLIES
Enthusiast

Re: Convert Volatile Table to Permanent Table

Hi,
Happy new year:)
Why do you want to convert volatile table to permanent table?
Just I want to know the reason becuase you can create permanent table with volatile table structure.

Thanks.
Enthusiast

Re: Convert Volatile Table to Permanent Table

You cannot convert the existing table to permanent, but you can:

Create Table permtable From volatiletable with Data ;

That will create a table same as the volatile table (columns, indices) and copy the data across.
As for why, if you have to go through a number of insert/ update steps to pull your data together, it is much faster in volatile because there is much less recovery overhead. Then just save it when you have finished.
Enthusiast

Re: Convert Volatile Table to Permanent Table

The correct syntax is:

Create Table permtable AS volatiletable with Data ;