Extracting Metadata
Go Up to Inspecting Database Objects
You can extract a metadata script to a file by displaying the desired metadata in the Metadata tab and clicking the Save Script toolbar button.
Extracting an entire database exports metadata in a specific order, to allow the resulting script to be used as input to recreate the database.
Metadata | Comments |
---|---|
1. Database |
Extracts database with default character set and |
2. Domains |
Must be before tables that reference domains. |
3. Tables |
Must be after domains. |
4. Indexes |
Must be after tables. |
5. |
Must be added after tables to avoid tables being referenced before they have been created. |
6. Views |
Must be after tables. |
7. |
Must be after tables. |
8. Exceptions |
Must be extracted before stored procedures and triggers that contain code to raise exceptions. |
9. Stored procedures |
Stored procedures are shown with no body in |
10. Triggers |
Must be after tables. Must be after stored procedures, to allow trigger code to reference procedures. Does not extract triggers from |
11. Roles |
Must be before |
12. |
Must be after tables, views, stored procedures, triggers, and roles. |
Items that are not extracted include:
- Code of external functions or filters, because that code is not part of the database. The declarations to the database (with
DECLARE EXTERNAL FUNCTION
andDECLARE FILTER
) are extracted. - System tables, system views, and system triggers.
- Because DDL statements do not contain references to object ownership, the extracted file does not show ownership. The output file includes the name of the object and the owner if one is defined. There is no way to assign an object to its original owner.