DETACH Statement
Syntax
Detaching does not delete the data or metadata of a table, a materialized view or a dictionary. If an entity was not detached , on the next server launch the server will read the metadata and recall the table/view/dictionary again. If an entity was detached PERMANENTLY
, there will be no automatic recall.
Whether a table or a dictionary was detached permanently or not, in both cases you can reattach them using the ATTACH query.
System log tables can be also attached back (e.g. , text_log
, etc). Other system tables can’t be reattached. On the next server launch the server will recall those tables again.
does not work with short syntax (without SELECT
), but you can attach it using the query.
Also you can not the detached table, or CREATE TABLE with the same name as detached permanently, or replace it with the other table with query.
Example
Creating a table:
Query:
Detaching the table:
Query:
Result:
See Also