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'