Consultor Eletrônico



Kbase P3883: How descending indexes is used with Dataserver SQL Server
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/25/2005
Status: Verified

GOAL:

How descending indexes with DataServer SQL Server

GOAL:

How to MS SQL DataServer uses Descending index

FACT(s) (Environment):

MS SQL DataServer
Windows 32 Intel
Windows NT 32 Intel/Windows 2000
Progress 9.1C
Progress 9.1D
Progress 9.1E

FIX:

The following steps demonstrate the use of Descending index when you migrate from a Progress database to a MS SQL Server database.

1. Create a new empty Progress database
2. Create a new Table with 1 field
3. Create a Descending Index which contain the field created earlier

Ex :
Table : tbl
Field : fld
Index : myIndex(fld) --> defined in the Data Dictionary as DESC index

4. Add the following records (can be done from Procedure Editor) :
insert into tbl values('jmr').
insert into tbl values('fleste').
insert into tbl values('ces').
insert into tbl values('zorro').
insert into tbl values('antoine').

5. Migrate this DB to SQL Server using ProtoMss utility (from the Data Administration, go to Dataservers -> MS SQL Server utilities -> Schema Migration tools -> Progress DB to MS SQL Server...)

One of the options is "Create DESC index". This option allows you to chose create an ASCending index in he SQL Server. The reason is SQL Server 7 does not support Descending Indexes. If this box is checked, all indexes are created as ascending. Note that this option affects only the SQL Server definition. Independently of this option, If your Progress database has a DESC index the "Adjust Schema", which is part of this ProtoMss utility, will create a DESC index in the schema holder.

6. Connect to the SQL Server DB using the connection option -Dsrv qt_debug,SQL

7. Run the following query :

for each tbl:
disp fld.

The result will be sorted in DESCing order.

8. Review the dataserv.lg file. Find there that the ORDER BY "fld" DESC is used.