Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

How to create sequence value in sybase database?

2 posts in Windows NT Last posting was on 2000-09-05 12:55:28.0Z
Anonymous Posted on 2000-09-05 08:31:52.0Z
Date: Tue, 5 Sep 2000 04:31:52 -0400
Newsgroups: sybase.public.sqlserver.nt
Subject: How to create sequence value in sybase database?
Message-ID: <08E1A735D01948A2002EDD0E85256951.002EDD1C85256951@webforums>
Lines: 4
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Path: forums-1-dub!!!!news
Xref: forums-1-dub sybase.public.sqlserver.nt:1676
Article PK: 1089147

Does anyone know how to create sequece value in sybase database just
like 'create sequence ...' in Oracle ?

David Owen Posted on 2000-09-05 12:55:28.0Z
Subject: Re: How to create sequence value in sybase database?
References: <08E1A735D01948A2002EDD0E85256951.002EDD1C85256951@webforums>
From: David Owen <>
Organization: Midsomer Consultants Inc.
Date: 05 Sep 2000 06:55:28 -0600
Message-ID: <>
Lines: 28
User-Agent: Gnus/5.0802 (Gnus v5.8.2) Emacs/20.5
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Newsgroups: sybase.public.sqlserver.nt
Path: forums-1-dub!!
Xref: forums-1-dub sybase.public.sqlserver.nt:1674
Article PK: 1089149

>>>>> "Anonymous" == Anonymous <> writes:

Sequences, per se, do not exist, what Sybase has are identity columns.
Whilst similar, they are not *exactly* the same. You build a table with
one of the columns defined thus


where <X> is replaced with a number representing the width of the identity

Then, when you insert into the table (you cannot specify a value for
column, so you have to name all of the columns, omitting the identity one),
it is auto-incremented. Does this make sense? I hope you get the
picture. You have to have an insert statment specifying all of the columns
*except* the identity. There, that's better.



PS You might want to read the FAQ, identities have a couple of "features"
that you might want to be aware of.

David Owen Midsomer Consultants Inc.
Maintainer of the Sybase FAQ: