Attach Schema



ATTACH SCHEMA copies a namespace, a schema with all of its documents, indexes, security policies and child schemas, from a folder into the database under the given name. The folder is usually one created by Detach Schema, possibly on another server.
  • The source folder is never modified, so the same folder can be attached more than once, under different names.
  • Every schema in the attached namespace gets a new id.
  • The parent of the new schema must already exist, and the new schema must not.
  • The output lists any indexes created by an older version of Katzebase, which must be rebuilt with Rebuild Index before they are used.
  • A failure never leaves a partially attached schema: the folder is copied to a staging area and checked before it is moved into place.

  • 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 Attaches a folder as WordList:Archive.
ATTACH SCHEMA WordList:Archive FROM 'D:\Exports\WordArchive'




API :: Client
Using the NTDLS.Katzebase.Api client library from .NET.
Home
The home page
SQL :: Alter Index
Creates and drops indexes and unique keys.
SQL :: Alter Schema
Creates, alters and drops schemas.
SQL :: Analyze Index
Reports the statistics of an index.
SQL :: Create Index
Creates an index or a unique key to speed up queries.
SQL :: Declare
Declares a variable for the rest of a script.
SQL :: Detach Schema
Removes a schema (namespace) from the database and moves its files to a folder.
SQL :: DocumentID
Removed: The DocumentID() function is no longer available.
SQL :: DocumentUID
Removed: The DocumentUID() function is no longer available.