alter table table add PROGRESS_RECID integer null |
alter table table add PROGRESS_RECID_IDENT_ integer identity |
create trigger _TI_table ON table for insert as
RAISERROR ('PSC-init',0,1) SET XACT_ABORT ON SET LOCK_TIMEOUT -1 if ( select PROGRESS_RECID from inserted) is NULL begin update t set PROGRESS_RECID = i.IDENTITYCOL from customer t JOIN inserted i ON t.PROGRESS_RECID_IDENT_ = i.PROGRESS_RECID_IDENT_ select convert (bigint, @@identity) end SET XACT_ABORT OFF |
create index table#_#progress_recid on table (PROGRESS_RECID)
|
create unique index table#_#progress_recid_ident_on table (PROGRESS_RECID_IDENT_)
|
create index table#_#index on table (column, PROGRESS_RECID)
|