Plus, after I pull over those 43,000 row from 'Jobs' in Sql Server, it won't be indexed, so, when I use it in a join with the local cursor, it seems like it will impact the speed of the local Select statement.
>>How do write a Select where you need to join a local (pre-existing) cursor with one or more tables from the Sql Server??
>>
>>In this example below from my current DBF-based app, lcCsrMtlRecords is a local cursor and I need join it to some lookup values that need to come from my Sql Server database (Jobs and Users).
>>
>>
>>Select Users.email ;
>> From (lcCsrMtlRecords) ;
>> Join Jobs On Jobs.job_num = &lcCsrMtlRecords..mat_code ;
>> Join Users On Jobs.quoted_by = Users.emp_num ;
>> Where qty_recd <> before_qty_recd ;
>> Order By 1 ;
>> Group By 1 ;
>>
>>
>>
>>
>>
>
>Get your Jobs and Users into local cursors and then join with them locally. You can not mix VFP data and SQL Server data in one statement.