Saturday, February 25, 2012

Alter Column as Identity

Hi All,
Is there a way to Alter an existing column and set it as an identity where t
he table contains data? TIA
A small sample code would be nice.No, you cannot alter an existing column to have the identity property. Your
options are limited to recreating the table or create another column as an
identity column.
Anith|||It's funny that you can manually set the column as an identity, but you can'
t programmatically change it.|||Actually, when you do it using EM (manually), a series of steps happen
behind the scenes : a new table is created with the identity column, the
data is copied, old one is dropped & the new table is renamed. You can see
the series of operations, by clicking on the save change script button on
the design table interface.
Anith

No comments:

Post a Comment