13.01.2013 Views

OpenEdge Data Management: DataServer for Microsoft SQL Server

OpenEdge Data Management: DataServer for Microsoft SQL Server

OpenEdge Data Management: DataServer for Microsoft SQL Server

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The <strong>Data</strong><strong>Server</strong> Tutorial<br />

7–38<br />

will be derived by default from a 64-bit value. (For prior releases, the value was<br />

derived, by default, from the 32-bit INTEGER.)<br />

To modify a table to support the ROWID function:<br />

1. Per<strong>for</strong>m these tasks:<br />

a. Add a column of the integer data type named PROGRESS_RECID. The new column<br />

must be able to contain null, as shown:<br />

alter table table<br />

add PROGRESS_RECID integer null<br />

b. Add a column with identity characteristics named PROGRESS_RECID_IDENT_. The<br />

new column must have the integer data type, as shown:<br />

alter table table<br />

add PROGRESS_RECID_IDENT_<br />

integer identity<br />

2. Create a trigger to maintain the PROGRESS_RECID column:<br />

create trigger _TI_table ON table <strong>for</strong> insert as<br />

RAISERROR ('PSC-init',0,1)<br />

SET XACT_ABORT ON<br />

SET LOCK_TIMEOUT -1<br />

if ( select PROGRESS_RECID from inserted) is NULL<br />

begin<br />

update t set PROGRESS_RECID = i.IDENTITYCOL<br />

from customer t JOIN inserted i ON<br />

t.PROGRESS_RECID_IDENT_ = i.PROGRESS_RECID_IDENT_<br />

select convert (bigint, @@identity)<br />

end<br />

SET XACT_ABORT OFF<br />

3. Create a non-unique index <strong>for</strong> the PROGRESS_RECID and a unique index <strong>for</strong> the<br />

PROGRESS_RECID_IDENT, respectively:<br />

create index #_#progress_recid on (PROGRESS_RECID)<br />

create unique index #_#progress_recid_ident_on <br />

(PROGRESS_RECID_IDENT_)<br />

4. Change the nonunique indexes so that they include a PROGRESS_RECID column as the last<br />

component, as shown:<br />

create index #_# on table (column, PROGRESS_RECID)<br />

5. If you have already created your schema holder, delete and recreate it.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!