>>
>>1) Do not use inlist() bu in ().
>>2) Unlike VFP you can send very long lists.
>>3) As list size increases it gets slower (SQL server needs to consume a larger input)
>>4) An alternative is to create a temp table on the same connection and insert values in that table then use a join (or in (select ... )). This approach works better if you are using the same query for both VFP and SQL.
>>Cetin
>
>Thank you, Cetin.
>
>Although I don't understand how to do item 4) in your list. How do you create a temp table in SQL Server without a stored procedure?
SQLExec(m.lnHandle,'create table #myIdList (myId i)')
SQLExec(m.lnHandle,'insert into #myIdList values (1)')
SQLExec(m.lnHandle,'insert into #myIdList values (2)')
SQLExec(m.lnHandle,'insert into #myIdList values (3)')
SQLExec(m.lnHandle,;
'select myTable.* from myTable inner join #myIdList ids on ids.myID = myTable.pkid', 'result')
Cetin