To create a new database file. This file may be on a different device.
CREATE DBSPACE dbspace-name AS filename
Anywhere.
Must have DBA authority.
Automatic commit.
The CREATE DBSPACE statement creates a new database file. When a database is first initialized using DBINIT, it is composed of one file. All tables and indexes created are placed in that file. CREATE DBSPACE adds a new file to the database. This file can be on a different disk drive than the root file allowing the creation of databases larger than one physical device.
The dbspace-name is an internal name for the database file. The filename is the actual name of the database file, with a path where necessary.
A filename without an explicit directory is created in the same directory as the main database file. Any relative directory is relative to the main database file. When you are using a SQL Anywhere, the filename is a filename on the server machine. When you are using the SQL Anywhere Server for NetWare, the filename should use a volume name (not a drive letter) when an absolute directory is specified.
Each table, including its associated indexes, is contained entirely within one database file. The IN clause of the CREATE TABLE statement the dbspace into which a table is placed. Tables are put into the root database file by default.
Create a dbspace called library to hold the LibraryBooks table and its indices.
CREATE DBSPACE library
AS 'e:\dbfiles\library.db' ;
CREATE TABLE LibraryBooks (
title char(100),
author char(50),
isbn char(30),
) IN library ;