I think this is what you want...
SELECT *
FROM contracts c INNER JOIN rela r
ON c.c_relcode = r.r_relcode
ORDER BY r.relname
You can't create a SQL Server index that references other tables. The only reason you can do it in VFP is because VFP will allow you to index expressions.
-Mike
>
>USE Contracts in 0
>USE Rela in 0
>SELECT Rela
>SET ORDER TO R_relcode
>SELECT Contracts
>SET RELATION TO C_relcode into RELA
>INDEX ON rela.relname INTO C_RELNAME
>
>Translated in words:
>We like to order to rela.relname with corresponding Contracts.
>
>In return we like this code transformed into SQL.