Creating tables in different databases  Using IDENTITY columns

Chapter 8: Creating Databases and Tables

create table syntax

The syntax of create table is in the Reference Manual.

NoteFor a complete discussion of the syntax, see create table in the Reference Manual.

The create table statement:

For example, the create table statement for the titles table in the pubs2 database is:

create table titles 
(title_id tid, 
title varchar(80) not null, 
type char(12), 
pub_id char(4) null, 
price money null, 
advance money null, 
royalty int null, 
total_sales int null, 
notes varchar(200) null,
pubdate datetime,
contract bit not null) 

The following sections describe components of table definition: system-supplied datatypes, user-defined datatypes, null types, and IDENTITY columns.

NoteThe on segment_name extension to create table allows you to place your table on an existing segment. segment_name points to a specific database device or a collection of database devices. Before creating a table on a segment, see a System Administrator or the Database Owner for a list of segments that you can use. Certain segments may be allocated to specific tables or indexes for performance reasons, or for other considerations.





Copyright © 2005. Sybase Inc. All rights reserved. Using IDENTITY columns

View this book as PDF