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.

Adding extended ABL support<br />

Using computed columns to enable PROGRESS_RECID<br />

support of the ROWID function<br />

Use the following procedures to create PROGRESS_RECID to support the ROWID function.<br />

Note that computed column technology is available only in MS <strong>SQL</strong> <strong>Server</strong> 2005 and later<br />

versions.<br />

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

1. Add new columns PROGRESS_RECID, PROGRESS_RECID_IDENT_ and<br />

PROGRESS_RECID_ALT_, as shown:<br />

ALTER TABLE table ADD PROGRESS_RECID AS<br />

CASE WHEN PROGRESS_RECID_ALT_ is NULL<br />

THEN PROGRESS_RECID_IDENT_<br />

ELSE PROGRESS_RECID_ALT_<br />

END PERSISTED NOT NULL,<br />

PROGRESS_RECID_IDENT_ bigint identity,<br />

PROGRESS_RECID_ALT_ bigint null default NULL,<br />

CONSTRAINT table#_#table progress_recid UNIQUE(PROGRESS_RECID)<br />

2. If you have already created your schema holder, delete and recreate it.<br />

Migrating RECID-trigger mechanism to RECID computed<br />

column mechanism<br />

Use the following procedure to convert a table that supports the ROWID function from one that is<br />

trigger-enabled to the more reliable computed column-enabled. Computed column enablement<br />

is available only through MS <strong>SQL</strong> <strong>Server</strong> 2005 and later.<br />

Note: Prior to per<strong>for</strong>ming the following steps, ensure you have backed up the tables with<br />

which you will be working.<br />

To adopt a table to support the ROWID function using computed column from trigger<br />

mechanism:<br />

1. Drop the trigger on INSERT <strong>for</strong> PROGRESS_RECID column as:<br />

DROP TRIGGER _TI_tbl-name<br />

GO<br />

2. Store the current identity value on the table as follows:<br />

select ident_current('') as old_identity_value<br />

go<br />

3. Drop the indexes on PROGRESS_RECID, PROGRESS_REID_IDENT_ columns as:<br />

7–39

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

Saved successfully!

Ooh no, something went wrong!