Answers

Question and Answer:

  Home  Sybase

⟩ How do I configure Identities in Sybase?

You can either create your table initially with the identity column:

1. create table ident_test

2. (text_field varchar(10),

3. ident_field numeric(5,0) identity)

4. go

Or alter an existing table and add an identity column:

1. alter table existing_table

2. add new_identity_field numeric(7,0) identity

3. go

When you alter a table and add an identity column, the System locks the table while systematically incrementing and adding unique values to each row. IF YOU DON'T SPECIFY a precision, Sybase defaults the size to 18! Thats 1,000,000,000,000,000,000-1 possible values and some major major problems if you ever crash your ASE and burn a default number of values... (10^18 with the default burn factor will burn 5^14 or 500,000,000,000,000 values...yikes).

 128 views

More Questions for you: