Setting the table-specific identity gap  Setting identity gap with select into

Chapter 8: Creating Databases and Tables

Setting identity gap with create table

The syntax is:

select IdNum into newtable
with identity_gap=20
from mytable
--------

For example:

create table mytable (IdNum numeric(12,0) identity)
with identity_gap = 10

This statement creates a table named mytable with an identity column. The identity gap is set to 10, which means ID numbers are allocated in memory in blocks of ten. If the server fails or is shut down with no wait, the maximum gap between the last ID number assigned to a row and the next ID number assigned to a row is ten numbers.





Copyright © 2005. Sybase Inc. All rights reserved. Setting identity gap with select into

View this book as PDF