Detach Schema



DETACH SCHEMA removes a namespace, a schema with all of its documents, indexes, security policies and child schemas, from the database and moves its files to a folder. The folder can later be attached to this or another database with Attach Schema.
  • The folder must not already exist.
  • The statement waits for other transactions that are using the schema to finish.
  • A failure never leaves a partially detached schema: the schema is unregistered before its files are moved, and is restored if the move fails.

  • Requires an account that is a member of an administrator role, because the statement reads and writes folders on the server.
  • Can't be used inside an explicit transaction, because moving files can't be undone by the transaction log.
  • The folder can be a quoted string or a string variable. It must be an absolute path, and must not be inside the server's data or transaction folders.
  • A folder path can't end with a backslash ('D:\Exports\'), because the backslash would escape the closing quote.



round-pushpin Detaches WordList:Translation to a folder.
DETACH SCHEMA WordList:Translation TO 'D:\Exports\Translation'




API :: Client
Using the NTDLS.Katzebase.Api client library from .NET.
Home
The home page
SQL :: Alter Schema
Creates, alters and drops schemas.
SQL :: Attach Schema
Copies a detached schema (namespace) into the database.
SQL :: Declare
Declares a variable for the rest of a script.
SQL :: DocumentID
Removed: The DocumentID() function is no longer available.
SQL :: DocumentUID
Removed: The DocumentUID() function is no longer available.
SQL :: Expressions
Literals, operators, comments and variables in KBSQL.
SQL :: Insert
Insert creates new documents in a schema.
SQL :: Keywords
A breakdown of all of the statements and keywords supported by the query processor.