Thank you so much, it has solved my problem!
Now, can you please tell me, whether or not it's fine to use numeric(10) to replace INT?
Main Topics
Browse All TopicsHi,
I want to create a table with an autoincrement field, with the following syntax:
CREATE TABLE auto1
( primary1 INTEGER NOT NULL DEFAULT AUTOINCREMENT,
data1 INTEGER NOT NULL,
PRIMARY KEY ( primary1 ) );
Sybase reports with an error:
Incorrect syntax near the keyword 'DEFAULT'.
I've tried every possible combination, such as removing NOT NULL, DEFAULT, etc.. However, the only way to create the table successfully is to remove the AUTOINCREMENT syntax.
Or is there any option in Sybase to turn off the autoincrement feature?
Anyone can help? Thank you.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: ahoorPosted on 2003-11-04 at 00:54:42ID: 9677068
I suppose you use Sybase ASE? autoincrement is not Sybase-syntax, use"identity" instead.
CREATE TABLE auto1
( primary1 numeric(10) identity,
data1 INTEGER NOT NULL,
PRIMARY KEY ( primary1 ) )
Also use the numeric datatype for identity columns, you get to decide how big it should be yourself. Since you wanted to use integer I think numeric(10) will do.