what is the proper sql syntax for making an existing column in a table to autoincrement? the table is already populated. the column is already primary key. I tried alter table dba.transaction alter transaction_ID AUTOINCREMENT and alter table dba.transaction alter transaction_ID BigInt AUTOINCREMENT but both failed

asked 09 Nov '13, 23:42

G_G's gravatar image

accept rate: 0%

I found the answer by using sybase central gui: alter the column in the target table for the autoincrement right click on the column and copy, paste to notepad and change the add to alter. voila: ALTER TABLE "dba"."transaction" alter "trans_ID" BIGINT NOT NULL DEFAULT AUTOINCREMENT

permanent link

answered 09 Nov '13, 23:48

G_G's gravatar image

accept rate: 0%

That's expected behaviour: AUTOINCREMENT is not a data type (say, other than IDENTITY or TIMESTAMP in MS SQL, AFAIK) but a column default, and so the syntax is the one to add/alter a default, as can been seen in the docs:


Here, cf. the "ALTER column-name column-alteration" clause.

(10 Nov '13, 16:09) Volker Barth
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 09 Nov '13, 23:42

question was seen: 8,161 times

last updated: 10 Nov '13, 16:09