Selecting an IDENTITY column into a new table  Adding a new IDENTITY column with select into

Chapter 8: Creating Databases and Tables

Selecting the IDENTITY column more than once

A table cannot have more than one IDENTITY column. If an IDENTITY column is selected more than once, it is defined as NOT NULL in the new table. It does not inherit the IDENTITY property.

In the following example, the record_id column, which is selected once by name and once by the syb_identity keyword, is defined as NOT NULL in stores_cal_pay60:

select syb_identity, record_id, stor_id, stor_name
into stores_cal_pay60
from stores_cal
where payterms = "Net 60"




Copyright © 2005. Sybase Inc. All rights reserved. Adding a new IDENTITY column with select into

View this book as PDF