Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Server
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Title:
Miscellaneous
Thread ID:
00380000
Message ID:
00383260
Views:
17
Bob,

What I am saying is that you are issuing a LOCAL select which uses a remote view named ptmast. The local view is getting ALL the records, then your local query retrieves its records from that view.

Are you typeing the queries below into the command window, or are you using SQLExec() to send them to the back end?

BOb

>Hi Bob,
>
>Actually, it is not that I am pulling 100% of the records, although I do see where you might have gotten that impression.
>
>Here is another example. I have a table on the SQL Server called ptmast in a database called aamast. I can create a connection string to it. I then execute a simple query such as
>
> SELECT name FROM ptmast WHERE name LIKE 'A%'
>
>OR SELECT ssn FROM ptmast WHERE ssn = "9999999999"
>
>OR SELECT * FROM ptmast WHERE pmid = "234233"
>
>or any other select statement. The number of records retrieved has NO IMPACT on the results.
>
>The FIRST time this query is run you can see the counter in the status bar count through ALL OF THE RECORDS (in the table, not the result) before the results are returned. If you close the connection, clear all tables, etc., and run it again, the same thing happens.
>
>However, if I do a SQLPrepare with the statement and send it to the server for processing, the count through the entire table does not occur.
>
>My question is this - Why does a simple select need to count through every record on the server the first time it is executed. Does this mean that the processing is occuring on my workstation instead of the server? Contrast that with SQLPrepare/Execute where the problem of counting through all of the records does not occur.
>
>Thanks for your patience,
>
>Bob
Previous
Reply
Map
View

Click here to load this message in the networking platform