Take a look at faq #8150 SPT cursor fetching and progress displaying for SPT cursor downloading.
>Hi all,
>
>I was just wondering if there are other settings I should set to speed up the asynch sqlexec() query. The example below shows that running the same query synch mode is much faster than in asynch mode. Is this always the case? Changing the fetchSize to a bigger value helped just a bit.
>
>Of course, this is just an example using the SQL Server Northwind database. Any real world data with more records than the example would show you better comparison. The backend table I query has many records with joins to other tables so that I need the asynch mode to provide user-feedback. The data is not displayed to the user and I need to process the returned cursor at once; meaning: background fetching is not really a viable solution.
>
>Any inputs most welcome.
>
>x=sqlconnect('Northwind')
>cursorsetprop("FetchSize",10000,0)
>z=datetime()
>sqlexec(x,'select * from dbo.[order details]')
>?datetime()-z
>sqlsetprop(x,'Asynchronous',.t.)
>i = 0
>z=datetime()
>do while .t.
> if sqlexec(x,'select * from dbo.[order details]') # 0
> exit
> endif
>enddo
>?datetime()-z
>sqldisconnect(x)
>
--sb--